修改root 密碼
1.關閉mysql
在系統設置中關閉
2.安全模式登錄并修改密碼
cd /usr/local/mysql/bin/
sudo su
./mysqld_safe --skip-grant-tables &
./mysql -uroot #root身份登錄
use mysql;
update MySQL.user set authentication_string=password('root123456') where user='root';
登錄mysql
cd /usr/local/mysql/bin/
sudo su
./mysql -uroot -p
登錄密碼過期
mysql -uroot -p
Enter password:ERROR 1862 (HY000): Your password has expired. To log in you must change it using a client that supports expired passwords.
上面的錯誤提示意思是需要用當前版本的客戶端登入,因為新用戶登入后需要立刻修改密碼,否則無法繼續后續的工作:
mysql> use mysql
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
mysql> set password = password('abc123456');
Query OK, 0 rows affected, 1 warning (0.00 sec)
解決MySQL中【Cannot load from mysql.proc. The table is probably corrupted】的問題
原因:MySQL升級完成后未對相關數據庫執行升級
執行命令
mysql_upgrade -uroot -p