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;
The default username is "root" default password is '' (empty/blank).
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.
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'] = '';
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
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.
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.
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