laravel

mysql8 之 authentication method u

2018-06-23  本文已影响7人  空气KQ

问题

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; 
上一篇 下一篇

猜你喜欢

热点阅读