Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 84
  • Last Modified:

Error connecting to mysql on localhost

Hello;

I have a connection to mysql via php code as below,and it was ok for years but today i get error connecting to database,what is the problem?

<?php
$connmag = mysql_pconnect($dbhostmag, $dbusermag, $dbpassmag) or die ('Error connecting to database,please refresh your page.');  
mysql_select_db($dbnamemag);                 
?>

Open in new window


I use win7+iis7.

thanks
0
MOSTAGHASSI
Asked:
MOSTAGHASSI
  • 2
1 Solution
 
Ryan ChongCommented:
make sure the MySQL service is running in your machine?
make sure the username and password provided are correct?
0
 
MOSTAGHASSIAuthor Commented:
mysql is not running it has error 2003.
0
 
MOSTAGHASSIAuthor Commented:
I started mysql and it is ok, thanks.
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now