- 初始化root密码
update user set password=PASSWORD (‘root’) where User='root';
- 允许mysql远程访问,可以使用以下两种方式:
a .修改user表
use mysql;
update user set host ='%' where user ='root';
select host,user from user;
b 授权
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;