作者:落梓- | 来源:互联网 | 2023-05-18 07:09
mysql默认只允许本地连接,也就是说,在安装完mysql后会存在两个root账户,他们的host分别是localhost和127.0.0.1usemysql;updateuser
mysql默认只允许本地连接,也就是说,在安装完mysql后会存在两个root账户,他们的host分别是localhost和127.0.0.1
use mysql;
update user set host=‘%‘ where user=‘root‘
flush privileges;
这样的就可以了
然后再对表给予相应的操作
grant 权限 on 数据库.* to 用户名@登录主机 identified by "密码";
例如:
grant all privileges on testDB.* to root@***-vuldb.localhost identified by ‘1234‘;
开启mysql远程连接