I've forgotten what I set as username and password for mysql
database. How could I be able to find it out? I am using wamp server. I am a newbie in mysql
.
So for example, to show MySQL users' username, password and host, we'll modify the sql query to accordingly as such: mysql> select user, password, host from mysql. user; The above sql query will present you with a list of users and their respective user name, password and database host.
You can find the current user name with CURRENT_USER() function in MySQL. for Ex: SELECT CURRENT_USER(); But CURRENT_USER() will not always return the logged in user. So in case you want to have the logged in user, then use SESSION_USER() instead.
Run following command in the Terminal to connect to the DBMS (you need root access): sudo mysql -u root -p; run update password of the target user (for my example username is mousavi and it's password must be 123456 ): UPDATE mysql.
Go to this file in: WampFolder\apps\phpmyadmin[phpmyadmin version]\config.inc.php
Usually wamp is in your main hard drive folder C:\wamp\
You will see something like:
$cfg['Servers'][$i]['user'] = 'YOUR USER NAME IS HERE'; $cfg['Servers'][$i]['password'] = 'AND YOU PASSWORD IS HERE';
Try using the password and username that you have on that file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With