giordanocardillo icon

How to recreate ROOT user account on MySQL

giordanocardillo | PRO | 09/01/13 02:40:54 PM UTC | 0 ⭐ | 234 👁️ | Never ⏰ | []
text |

470 B

|

None

|

0 👍

/

0 👎

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