如果你连接出错
ERROR 1130: Host '192.168.1.213' is not allowed to connect to this MySQL server
解决方案:
mysql>use mysql;
mysql>update user set host = '%' where user = 'root';
mysql>select host, user from user;
注意:这里host,user是一个主键。如果报错,请修改为唯一
1.如果允许任意主机连接
GRANT ALL PRIVILEGES ON *.* TO 'youruser'@'%' IDENTIFIED BY 'yourpassword' WITH GRANT OPTION;
2.如果限制一个ip连接
GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'192.168.1.213' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;