新版mysql 远程连接数据库

新版mysql改变了一些设定

要想远程连接输入以下内容

CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';

GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost' WITH GRANT OPTION;

CREATE USER 'username'@'%' IDENTIFIED BY 'password';

GRANT ALL PRIVILEGES ON *.* TO 'username'@'%' WITH GRANT OPTION;
 
CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
 
GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost' WITH GRANT OPTION;
 
CREATE USER 'username'@'%' IDENTIFIED BY 'password';
 
GRANT ALL PRIVILEGES ON *.* TO 'username'@'%' WITH GRANT OPTION;

  

原文地址:https://www.cnblogs.com/zlshy/p/14934476.html