问题
The server requested authentication method unknown t
o the client
解决
新增加一个用户
先进入mysql 命令
允许本地 IP
创建用户kongqi,密码是123456
create user 'kongqi'@'localhost' identified by '123456';
创建允许外网访问
create user 'kongqi'@'%' identified by '123456';
flush privileges;
为用户创建数据库
create database test DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
为新用户分配权限
grant all privileges on `你的数据库名字`.* to 'kongqi'@'%' identified by '123456';
授予用户在本地服务器对该数据库的全部权限
grant all privileges on `testdb`.* to 'kongqi'@'localhost' identified by '123456';
flush privileges;
网友评论