mysql.user 表。killall -TERM mysqldbin/mysqld_safe --skip-grant-tables &mysql -u rootmysql> USE mysql;
mysql> UPDATE user SET password=PASSWORD('new_pass') WHERE user='root';
mysql> FLUSH PRIVILEGES;
killall -TERM mysqld,然後以標準方式啟動 MySQL,新密碼即生效。--skip-grant-tables 會關閉所有權限檢查,**務必在安全網路環境下短暫使用**,修改完畢立即重啟關閉此模式。authentication_string,語法需調整:UPDATE user SET authentication_string=PASSWORD('new_pass') WHERE user='root';validate_password 插件,新密碼需符合複雜度策略。