mysql忘记root密码
# vim /etc/my.cnf [mysqld] #add for free password skip-grant-tables # service mysql restart # mysql mysql> update mysql.user set password=password("1234abcd") where user='root'; Query OK, 3 rows affected (0.00 sec) Rows matched: 3 Changed: 3 Warnings: 0 mysql> flush privileges; Query OK, 0 rows affected (0.00 sec) mysql> exit Bye # vim /etc/my.cnf =>#skip-grant-tables # service mysqld restart # mysql -uroot -p1234abcd