1.更新密码
ALTER USER 'root'@
'localhost'
IDENTIFIED BY
'新密码';
2.
允许远程访问
1.允许任何ip地址(%表示允许任何ip地址)的电脑用admin帐户和密码(123456)来访问这个mysql server。
grant all privileges on *.* to 'admin'@'%' identified by '123456' with grant option;
2.立即执行上述语句
flush privileges;
3.查看系统用户
use mysql
select user, host from user;
3.如果第二条不可以
mysql -u root -p mysql>use mysql; mysql>update user set host = '%' where user = 'root'; mysql>select host, user from user;