CentOS 7 MySQL 5.7 root password reset

To reset MySQL 5.7 root password on CentOS 7 server, do the following

Stop MySQL Server

Set the MySQL MYSQLD_OPTS environment to start MySQL with –skip-grant-tables

Start MySQL with –skip-grant-tables

Login as user root

Update MySQL root password

Or

Exit MySQL command prompt

Stop MySQL server

Unset the MySQL environment option

Start MySQL normally

Now you should be able to log in with new MySQL root password using

See Reset MySQL root password, mysql_safe: command not found

Leave a Reply

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