How to recreate ROOT user account on MySQL
Hot to recreate ROOT user account on MySQL:
In bash:
service stop mysqld;
mysqld_safe --skip-grant-tables &;
mysql -u root;
Inside mysql:
mysql>use mysql;
mysql>flush privileges;
mysql>create user root@localhost;
mysql>flush privileges;
mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' with grant option;
mysql>UPDATE mysql.user SET Password=PASSWORD('<<< YOUR PASSWORD HERE >>>') WHERE User='root';
mysql>flush privileges;
mysql>quit;
And you're done! ;)
Comments