• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 98
  • Last Modified:

Error connecting to mysql on localhost


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?

$connmag = mysql_pconnect($dbhostmag, $dbusermag, $dbpassmag) or die ('Error connecting to database,please refresh your page.');  

Open in new window

I use win7+iis7.

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

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

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