#2003 - Can't connect to MySQL server on 'localhost' (10061)

I have WAMP installed on my local PC. I had been using the mysql console to create my database files. Now I had created a gallery page for a site where the photos are being drawn from a database.

I had gone through the following steps.

[LIST]
[]On my local machine, I exported the database to a .sql file.
[
]Logged on to cpanel of HG and created a MySQL database called photogallery.
[]Still in the cpanel at HG, created a database user called jppp.
[
]Added a username with privileges.
[]Still in the cpanel at HG, clicked on phpmyadmin, located the database, and then imported the .sql file.
[
]I got the message, “database imported successfully”.
[/LIST]Meanwhile, I had gone to the config.inc file on my local machine and did the following.

[LIST]
[*]Changed the name of my database from photogallery to jppp_photogallery.
[/LIST]I thought that I was on the right track. But just yesterday, I had visited the local server and found that the phpadmin link is not working.
I am getting an error like this;

[center]Welcome to phpMyAdmin 2.11.6[/center]

Error

MySQL said: #2003 - Can’t connect to MySQL server on ‘localhost’ (10061)

I was quite shocked to see this. I tried closing down my computer and logging in again. But I continue to get the same error. I tried logging on to mysql console after starting the wamp server. I do not have any problem there.

Then I went to my local server ([FONT=Times New Roman]http://127.01.01[/FONT]) and tried visiting my gallery page. But I find that I am having a problem there too.

When I try to go to my viewgallery.php page, I get the following error.

Warning: mysql_connect() [function.mysql-connect]: Access denied for user ‘Username’@‘localhost’ (using password: YES) in C:\wamp\www\xyz.com\config.inc.php on line 3[FONT=Tahoma][COLOR=black]
Could not select database

[/COLOR][/FONT]
Now how can there be an error on line 3 suddenly when it was working fine till now. Has it got anything to do with the export and import that I did? Why have I run into an error like this suddenly?
#2003 - Can’t connect to MySQL server on ‘localhost’ (10061)

The error message means a password is being sent to the database but is not the correct password for that user and that database.

Thanks. But how could the password have changed suddenly when it was working fine till last week? I noticed this problem only after I finished the task of exporting and importing the files.

When I logged in to my local server today, I found that the phpadmin link is working again. I really do not know what had gone wrong.
But I am still not able to go to my gallery page, viewgallery.php. I do not know why I am facing this problem inspite of not having made any changes in the config.inc.php file.
Should I go and change the username and password? I need some help to do it. Actually, when I had set the username and password, a friend had helped me to do it. And I had written the code for the config.inc.php file giving that username and password. Now, I tried googling and tried going to tutorials to find out how to set a new username and password so that I can try changing those in the config.inc.php file and try opening my gallery page once again.
But I have not succeeded so far.

Can someone help me please?

This is more a question to do with php and the config file for it since you can already get into mysql, just not through your script. Have a moderator move the thread for you.

I had so far been working directly on the webhost’s server. I went to check the phpadmin page of my local server today and once again found that it is not working and is giving the same error that I had mentioned above. More so, when I try to log on to MySQL using the mysql console, I find that the MS Dos screen flashes and then disappears. Why do I continue to get this type of problems?