Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find out the username and password for mysql database

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.

like image 604
Abhishek Avatar asked Apr 24 '10 09:04

Abhishek


People also ask

How do I find MySQL database username and password?

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.

How do I find my username for MySQL?

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.

How do I find MySQL username and password Windows?

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.


1 Answers

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.

like image 113
Fábio Antunes Avatar answered Sep 27 '22 22:09

Fábio Antunes