Python接口自动化测试和性能测试

MySQL5.7 增加用户,新建数据库,授权,远程访问

2018-12-24  本文已影响54人  梨花菜

Centos7 yum安装MySQL5.7

新增用户

mysql -u root -p 
CREATE USER myuser'@'localhost' IDENTIFIED BY 'mypassword'; #本地登录 
CREATE USER 'myuser'@'%' IDENTIFIED BY 'mypassword'; #远程登录 
quit 
mysql -u myuser -p #测试是否创建成功

如果出现以下问题,可以参考这个链接

为用户授权

create database testDB default charset utf8 collate utf8_general_ci;
grant all privileges on testDB.* to 'myuser'@'localhost' identified by 'mypassword'; 本地授权
grant all privileges on testDB.* to 'myuser'@'%' identified by 'mypassword'; 远程授权
flush privileges; #刷新系统权限表
grant select,update on testDB.* to 'myuser'@'localhost' identified by 'mypassword'; 
flush privileges; #刷新系统权限表

Centos7 yum安装MySQL5.7
MySql 5.7中添加用户,新建数据库,用户授权,删除用户,修改密码

上一篇 下一篇

猜你喜欢

热点阅读