One day i forgot myql root user password. Then i found simple steps to change it without reinstall mysql server.
1. Open console and stop mysql service
2. Then i run this service without password
you can run it as a background if you would not use another console (shell)
3. Then i open another console and connect to mysql
output
4. Next, i setup new password for root user
5. Last step is stop mysql service
6. Finish, and start mysqld and test new password
1. Open console and stop mysql service
#/etc/init.d/mysqld stop
2. Then i run this service without password
#mysqld_safe --skip-grant-tables
you can run it as a background if you would not use another console (shell)
#mysqld_safe --skip-grant-tables &
3. Then i open another console and connect to mysql
#mysql -u root
output
mysql>
4. Next, i setup new password for root user
mysql> use mysql;
mysql> update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root';
mysql> flush privileges;
mysql> quit
5. Last step is stop mysql service
#/etc/init.d/mysqld stop
6. Finish, and start mysqld and test new password
#/etc/init.d/mysqld start
#mysql -u root -p