I forgot MySql root password. How can I find it?
How can I back up database and import new database?
I tried to change root password and authority in user password, in this file;
"c:/Program Data/MySql/MySql Server 5.6/data/mysql/user.frm"
I forgot MySql root password. How can I find it?
How can I back up database and import new database?
I tried to change root password and authority in user password, in this file;
"c:/Program Data/MySql/MySql Server 5.6/data/mysql/user.frm"
Mysql change forgotted password
0) shut down service mysql56 1) go to C:\ProgramData\MySQL\MySQL Server 5.6 (note that ProgramData is a hidden folder) 2) look for file my.ini, open it and add one line skip-grant-tables below [mysqld], save [mysqld] skip-grant-tables 3) start service mysql56 4) by right, you can access the database, and use the query below to update the password update mysql.user set password=PASSWORD('NEW PASSWORD') where user='root'; 5) shun down the service again, remove the line skip-grant-tables save it, and start the service again. try to use the password you set to login. To reset the password Follow these steps (can be helpful if you really forget your password and you can try it anytime, even if you're not in the situation at the moment):
Stop mysql
sudo /etc/init.d/mysql stop or for other distro versions
sudo /etc/init.d/mysqld stop Start MySQL in safe mode
sudo mysqld_safe --skip-grant-tables & Log into MySQL using root
mysql -uroot Select the MySQL database to use
use mysql; Reset the password
update user set password=PASSWORD("mynewpassword") where User='root'; Flush the privileges
flush privileges; Restart the server
quit Stop and start the server again
ubuntu and debian
sudo /etc/init.d/mysql stop ...
sudo /etc/init.d/mysql start On CentOS and Fedora and RHEL
sudo /etc/init.d/mysqld stop ... sudo /etc/init.d/mysqld start Login with new password
mysql -u root -p Type new password and enjoy your server again like nothing happened
taken from mysql-resetting-a-lost-mysql-root-password
The wiki also explains other ways to reset the password using a text file.