mysql_rootpass_short
This is a quicker, less intrusive method with less downtime to reset mysql root password: Create the following file and then enter the command that follows
vim /var/lib/mysql/mysql.init
SET PASSWORD FOR 'root'@'localhost'=PASSWORD('mynewpassword');
Now edit: /etc/my.cnf and enter the following under the [mysqld] block
init_file=/var/lib/mysql/mysql.init
service mysqld restart
mysql -u root -pNow delete the /var/lib/mysql/mysql.init and init_file=/var/lib/mysql/mysql.init line entered in /etc/my.cnf file
DONE
mysql_rootpass_short.txt · Last modified: 2024/05/23 07:26 by 127.0.0.1