美文网首页laravel
mysql8 之 authentication method u

mysql8 之 authentication method u

作者: 空气KQ | 来源:发表于2018-06-23 16:19 被阅读7次

问题

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; 

相关文章

网友评论

    本文标题:mysql8 之 authentication method u

    本文链接:https://www.haomeiwen.com/subject/nmxdyftx.html