Mysql修改密码,及修改访问权限
1.修改密码
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('MyNewPassword');
或者
update user set password=PASSWORD(‘123456’) where User='root';
2.修改访问权限
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'WITH GRANT OPTION; //任何远程主机都可以访问数据库 mysql> FLUSH PRIVILEGES; //需要输入次命令使修改生效
或者
update user set host = '%' where user = 'root';