service mysqld stop
mysqld_safe --skip-grant-tables &
update mysql.user set authentication_string=password('123qwe') where user='root' and Host = 'localhost';mysql
service mysql restart
set password for 'root'@'localhost'=password('123');
注意密碼強度sql