mysql 默认只能访问本机,如何使其远程访问了。如:
开发过程中A机,想访问位于B机上的数据库
//改表法
update user set host = '%' where user = 'root';mysql>select host, user from user;
//创建新用户,拥有mydb数据库的增删改查操作权限:
grant select,insert,update,delete on mydb.* to test@localhost identified by “abc”;
//创建一个超级用户,拥有所有权限grant all *.* to 用户名@服务器地址[数据库地址:localhost] identified by "密码";
//允许用户para 从ip为172.18.95.19 的主机连接到mysql服务器
grant all privileges on bank.* to mysqltest@'172.18.95.19' identified by "mysqltest" with grant option
//允许来自任何ip为'%' 的主机连接到mysql服务器
grant all privileges on bank.* to mysqltest@'%' identified by "mysqltest" with grant option