• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 89
  • 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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