views:

301

answers:

4

Hi, I ve forgot 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 and its time to get started for my first project.Please help.

A: 

Open phpmyadmin, go to database and corresponding table to find it out.

Sarfraz
You know the passwords aren't stored in plaintext right?
James
@James Goodwin: Yes, that's true, don't know whether he is storing in plain text or encrypting it.
Sarfraz
@Sarfraz The OP is referring to the password for the MYSQL user, not an ordinary password stored in a user created table. By default MySQL encrypts the password in the `mysql.user` table using the `PASSWORD()` function.
James
A: 

In your local system right,

   go to this url : http://localhost/phpmyadmin/

   In this click mysql default db, after that browser user table to get existing username and password.
Karthik
I saw the password but i think this is not the passwd i created. Its a long computer generated one, is that it?
aeonsleo
that password only we used in projects, so use that one
Karthik
A: 

Assuming that the user you are using in phpmyadmin has the necessary privileges, you can run this query to change the root password:

UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root';
FLUSH PRIVILEGES;
James
Ive executed the above querry now it gives following error..#1045 - Access denied for user 'root'@'localhost' (using password: NO)
aeonsleo
@aeonsleo: Check out the MySQL documentation for how to change the mysql root password if you have no access: http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html#resetting-permissions-windows
James
+1  A: 

Hi there aeonsleo.

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.

Hope it helps.

Fábio Antunes
Thank You It helped.
aeonsleo
@aeonsleo: Good to know. PS: Don't forget to mark as accepted the answer that as enabled you to solve your problem.
Fábio Antunes