mysql_rootpass
Warning: Undefined variable $html in /usr/share/nginx/html/lib/plugins/tabinclude/helper.php on line 240
Resetting Mysql Root Password
- One-Restart Version
- Standard Practice Version
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
1 |
vim /var/lib/mysql/mysql .init |
1 |
SET PASSWORD FOR 'root' @ 'localhost' =PASSWORD( 'mynewpassword' ); |
Now edit: /etc/my.cnf and enter the following under the [mysqld] block
1 |
init_file= /var/lib/mysql/mysql .init |
1 |
service mysqld restart |
1 |
mysql -u root -p |
DONE
mysql_rootpass.txt · Last modified: 2024/05/23 07:26 by 127.0.0.1