jppp — 2009-06-16T04:12:20-04:00 — #1
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.
- 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”.
Meanwhile, I had gone to the config.inc file on my local machine and did the following.
- Changed the name of my database from photogallery to jppp_photogallery.
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;
Welcome to phpMyAdmin 2.11.6
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 (http://127.01.01) 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
Could not select database
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)
guelphdad — 2009-06-16T11:28:51-04:00 — #2
The error message means a password is being sent to the database but is not the correct password for that user and that database.
jppp — 2009-06-17T03:00:09-04:00 — #3
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.
jppp — 2009-06-18T10:23:42-04:00 — #4
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.
jppp — 2009-06-19T10:27:39-04:00 — #5
Can someone help me please?
guelphdad — 2009-06-19T15:11:57-04:00 — #6
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.
jppp — 2009-06-27T09:43:41-04:00 — #7
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?