I recently installed LAMP on Ubuntu 13.04(32-bit) but forgot my phpMyAdmin password. How can I reset its password without re-installing it?
4 Answers
Simply change or reset your MySQL root password by doing the following:
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
-
Can you please explain the use of #2 Start mysqld? Also, how will I be able to execute #3 since I don't remember my MySQL password anymore? Jul 22, 2013 at 16:40
-
1The idea for #2 is that you are spawning a version of the MySQL daemon without a password. This allows you to reset it on step 4.– jctoledoAug 6, 2013 at 15:54
-
Using Ubuntu 16 I was not able to run mysqld manually - trying to create socket and socket lock file in a dir that didn't even exist! But if you look at the very NEXT answer (which is not the accepted answer) that is what I needed - I stupidly forgot the password for the phpmyadmin user, and there it is, in plain text, in the phpmyadmin.conf folder!– Brian BSep 6, 2017 at 18:09
-
-
I get
2020-09-22 10:40:17 140163612645568 [Note] mysqld (mysqld 10.2.14-MariaDB) starting as process 23841 ... mysqld: Please consult the Knowledge Base to find out how to run mysqld as root! 2020-09-22 10:40:17 140163612645568 [ERROR] Aborting
at step 2– BlackSep 22, 2020 at 8:40
You don't actually need to reset your username and password, if you can see them.
In your terminal window, type:
sudo -H gedit /etc/dbconfig-common/phpmyadmin.conf
This will open your phpmyadmin configurations.
There, you will see your username under dbc_dbuser='your_username'
and password under dbc_dbpass='your_password'
.
-
I could not able to find **/etc/dbconfig-common/ ** path. Both "MySQL Database" & "Apache Web Server" running successfully. Any suggestion !! This I'm trying to work on Wordpress.– CoDeAug 1, 2016 at 9:41
-
1Don't forget to restart mysql " sudo service mysql restart " Aug 24, 2016 at 15:15
-
1I found a user called
phpmyadmin
, but not my mainroot
user. That user also did not have permissions to add new users or databases! Aug 24, 2016 at 22:57 -
1
-
There is a workaround on Debian (Ubuntu, Mint, etc.) where there is a second admin account automatically generated by the system called
debian-sys-maint
You can see (and should not change) its password via
sudo nano /etc/mysql/debian.cnf
It is possible (sure on Ubuntu 16.04) to use that account both in phpMyAdmin as well as in the command line
mysql -u debian-sys-maint -p
The account has exactly the same privileges as phpMyAdmin's / MySQL's root.
I was wondering why my login was failing even though I never changed the password.
It was failing because I rebootet the server and the mysql server was not startet automatically. So I startet the server and it worked again.