Mysql默认关闭远程登录权限,如下操作允许用户在任意地点登录:
1. 进入mysql,GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '' WITH GRANT OPTION;
IDENTIFIED BY后跟的是密码,可设为空。
grant all privileges on *.* to 'root'@'%' identified by 'root' with grant option;
grant all privileges on *.* to 'root'@'slave1' identified by 'root' with grant option; 或者指定主机名
2. FLUSH privileges; 更新