Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get phpmyadmin username and password

I have intalled phpmyadmin recently in my system. Now I lost its username and password. I tried the below methods for login.

in etc/phpmyadmin/config.inc.php I activated the AllowNoPassword

$cfg['Servers'][$i]['AllowNoPassword'] = TRUE;

like image 272
John Mathew Avatar asked Oct 14 '14 07:10

John Mathew


People also ask

What is phpMyAdmin default username and password?

The default username is "root" default password is '' (empty/blank).

How do I find MySQL 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.


4 Answers

 Step 1:

    Locate phpMyAdmin installation path.

    Step 2:

    Open phpMyAdmin>config.inc.php in your favourite text editor.

    Step 3:

    $cfg['Servers'][$i]['auth_type'] = 'config';
    $cfg['Servers'][$i]['user'] = 'root';
    $cfg['Servers'][$i]['password'] = '';
    $cfg['Servers'][$i]['extension'] = 'mysqli';
    $cfg['Servers'][$i]['AllowNoPassword'] = true;
    $cfg['Lang'] = '';
like image 171
Hara Prasad Avatar answered Oct 05 '22 18:10

Hara Prasad


Try changing the following lines with new values

$cfg['Servers'][$i]['user'] = 'NEW_USERNAME';
$cfg['Servers'][$i]['password'] = 'NEW_PASSWORD';

Updated due to the absence of the above lines in the config file

Stop the MySQL server

sudo service mysql stop

Start mysqld

sudo mysqld --skip-grant-tables &

Login to MySQL as root

mysql -u root mysql

Change MYSECRET with your new root password

UPDATE user SET Password=PASSWORD('MYSECRET') WHERE User='root'; FLUSH PRIVILEGES; exit;

Kill mysqld

sudo pkill mysqld

Start mysql

sudo service mysql start

Login to phpmyadmin as root with your new password

like image 32
geoandri Avatar answered Oct 05 '22 18:10

geoandri


Try opening config-db.php, it's inside /etc/phpmyadmin. In my case, the user was phpmyadmin, and my password was correct. Maybe your problem is that you're using the usual 'root' username, and your password could be correct.

like image 35
Hanz Marín Avatar answered Oct 05 '22 17:10

Hanz Marín


If you don't remember your password, then run this command in the Shell:

mysqladmin.exe -u root password NewPassword

where 'NewPassword' is your new password.

like image 20
Vidhyut Pandya Avatar answered Oct 05 '22 17:10

Vidhyut Pandya