How to find out the username and password for mysql database

MysqlPasswords

Mysql Problem Overview


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.

Mysql Solutions


Solution 1 - 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.

Solution 2 - Mysql

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;

Solution 3 - Mysql

If you forget your password for SQL plus 10g then follow the steps :

  1. START
  2. Type RUN in the search box
  3. Type 'cnc' in the box captioned as OPEN and a black box will appear 4.There will be some text already in the box. (C:\Users\admin>) Just beside that start typing 'sqlplus/nolog' press ENTER key
  4. On the next line type 'conn sys/change_on_install as sysdba' (press ENTER) 6.(in the next line after sql-> type) 'alter user scott account unlock' .
  5. Now open your slpplus and type user name as 'scott' and password as 'tiger'.

If it asks your old password then type the one you have given while installing.

Solution 4 - Mysql

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.

Solution 5 - Mysql

One of valid JDBC url is

jdbcUrl=jdbc:mysql://localhost:3306/wsmg?user=root&password=root

Solution 6 - Mysql

There are two easy ways:

  1. In your cpanel Go to cpanel/ softaculous/ wordpress, under the current installation, you will see the websites you have installed with the wordpress. Click the "edit detail" of the particular website and you will see your SQL database username and password.

  2. In your server Access your FTP and view the wp-config.php

Solution 7 - Mysql

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionAbhishekView Question on Stackoverflow
Solution 1 - MysqlFábio AntunesView Answer on Stackoverflow
Solution 2 - MysqlJames GoodwinView Answer on Stackoverflow
Solution 3 - MysqlRishi TiwariView Answer on Stackoverflow
Solution 4 - MysqlKarthikView Answer on Stackoverflow
Solution 5 - MysqlAmit AggarwalView Answer on Stackoverflow
Solution 6 - MysqlTimothyView Answer on Stackoverflow
Solution 7 - MysqlSarfrazView Answer on Stackoverflow