Mysql 5.7 创建用户同时授权
三.创建用户同时授权
mysql -u root -p
CREATE USER ‘dev’@‘localhost' IDENTIFIED BY ‘dev’; #本地登录
CREATE USER ‘dev’@‘%’ IDENTIFIED BY ‘dev’; #远程登录
quit
mysql -utest -p #测试是否创建成功
mysql> grant all on *.* to ‘dev’@‘%’ identified by ‘dev’;
mysql> flush privileges;
连接远程数据库
mysql -h127.0.0.1 -udev -p