mysql> grant all privileges on *.* to root@'localhost' identified by '密码'; mysql> flush privileges; # 或者 mysql> grant all privileges on *.* to root@'%' identified by '密码'; mysql> flush privileges;