I am guessing a bit here but from this statement you made about what you did when using phpMyAdmin and trying to set a password :-
So, I went to the mysql link on the left panel and put a password to my database.
I can only assume you opened the mysql
database and edited the User
table and manually edited the PASSWORD
column for the root
userids.
That is not how you set a password for your MYSQL users. That is how you totally screw up your MySQL server!!
The PASSWORD
column of the Users
table of the mysql
database is actually hashed when you create a password in the correct way, so whatever password you try to enter from your WP PHP code will never match the one you have set in mysql.
As it is the root
userid that you have now made inaccessable your options are limited.
You could uninstall WAMPServer, delete the C:\wamp\
folder and then try installing WAMPServer again. That would definitely fix your problem.
Alternatively you could try this first :-
Stop the mysql service
wampmanager -> MySQL -> Service -> Stop Service
Edit the my.ini file
wampmanager -> MySQL -> my.ini
Find the [wampmysqld]
section header or the [wampmysqld64]
section if you are using WAMPServer 64bit in the ini file and add this line directly after the section [wampmysqld]
skip-grant-tables
Restart the mysql service.
wampmanager -> MySQL -> Service -> Start/Resume Service
Open the MySQL console
wampmanager -> MySQL -> MySQL Console
Now we are going to reset the password for the root user, of course this could be used to reset any users password. Enter the following 2 commands at the mysql> command prompt, each with a semi colon at the end of a line, and press ENTER after each line to issue the command to mysql.
UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE user='root';
FLUSH PRIVILEGES;
Note that the update should report that it has updated more than one row, that because there are actually 3 user accounts with the userid of 'root' each with a different domain i.e. 127.0.0.1, localhost and ::1
Now enter quit
at the mysql command promt to exist mysql.
Stop the mysql service
wampmanager -> MySQL -> Service -> Stop Service
Edit the my.ini file
wampmanager -> MySQL -> my.ini
Find the [wampmysqld]
or [wampmysqld64]
section in the ini file
Remove the 'skip-grant-tables' parameter we added earlier.
DO NOT Leave this parameter in the ini file its a HUGH security hole.
Restart the mysql service.
wampmanager -> MySQL -> Service -> Start/Resume Service
To be able to login to phpMyAdmin you will now have to tell phpMyAdmin that you have changed the password for the root userid. So :-
Edit \wamp\apps\phpmyadmin4.1.14\config.inc.php
Find this line $cfg['Servers'][$i]['password'] = '';
And add your new pasword to there like this :
$cfg['Servers'][$i]['password'] = 'The_New_Password';
You should now be able to login with phpmyadmin using the userid 'root' and the new password you have just set for that user.
Now you can edit the WordPress config file and put this new password into there.
Of course you should not be using the root
userid for any of your projects.
You shoudl instead be creating a specific userid account in MySQL for each of your projects and allocating the required privilages to that account only to access the one database that that project requires.
Before you go much further can I suggest that you do some reading from the following manuals.
The phpMyAdmin manual
The MySQL Manual