Linux 4 All

Best Linux tricks source

Reset MySQL password

Standard method is to stop MySQL server, start it with –skip-grant-tables, update root password and restart again the server.

You can do it without ski-grant-tables and with one MySQL restart.

1. Add this line to /etc/my.cnf

init_file=/var/lib/mysql/mysql.init

2. Create /var/lib/mysql/mysql.init with contents:

SET PASSWORD FOR 'root'@'localhost'=PASSWORD('mynewpassword'); FLUSH PRIVILEGES;

3. Restart MySQL service

4. Delete /var/lib/mysql/mysql.init and /etc/my.cnf entry

Remove duplicate RPM packages arrow-right
Next post

arrow-left Reset RPM permissions
Previous post

Leave a Reply

Your email address will not be published. Required fields are marked *