3.11 设置root密码 mysql> UPDATE user SET password=PASSWORD('newpassword') where USER='root'; mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'newpassword' WITH GRANT OPTION; # 设置远程ip可连接 mysql> FLUSH PRIVILEGES; # 记得要这句话,否则如果关闭先前的终端,又会出现原来的错误。