zondag 26 augustus 2018

Reset MYSQL root password on Centos


Stop MYSQL
systemctl stop mysqld

Set mysql env options
systemctl set-enviroment MYSQLD_OPTS ="--skip-grant-tables"

Start MYSQL
systemctl start mysqld

Update password using query
mysql -u root
UPDATE mysql.user SET authentication_string = PASSWORD('ENTER NEW PASSWORD') WHERE User='root' AND host = 'localhost';
FLUSH PRIVILEGES;
QUIT

Stop mysqld
systemctl stop mysqld

Unset enviroment
systemctl unset-enviroment MYSQLD_OPTS
systemctl start mysqld


Geen opmerkingen:

Een reactie posten