mysql用户远程登录

方法一

1
2
3
4
5
6
7
8
9
10
11
command 1:

grant (all privileges)
on database.table
to username@'ip'
idenitfied by 'password'
with grant option;

command 2:

flush privileges;

all privileges 可以替换为相应的权限 比如:select,update,insert

username 为mysql 用户名

ip 为可以远程访问的ip,%代表所有地址都可以访问

password 为 密码