問題匯總
更新mysql root密碼
- 在配置my.ini中設(shè)置skip-grant-tables
- 進(jìn)入命令行
> mysql
mysql> use mysql
Database changed
mysql> update mysql.user set authentication_string=password('root') where user='root';
Query OK, 1 row affected, 1 warning (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 1
- 將之前修改my.ini刪除
- 使用管理員重新啟動(dòng)mysqld restart,如果是windows可以使用MySQL Notifier重啟mysql數(shù)據(jù)庫
ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement
首先,需要刷新一下權(quán)限管理
mysql> flush privileges;
# 然后在執(zhí)行就行了
mysql> create user 'web'@'localhost' identified by 'xxx';
mysql> grant all on xinhua.* to 'web'@'localhost';
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
修改密碼
mysql> alter user 'web'@'localhost' identified by 'web';