1、登录数据库引擎:mysql -h 127.0.0.1 -P 3308 -u root -p
2、使用数据库:use mysql;
3、创建用户test和密码为123456的用户:
(1)、本地登录:create user 'test'@'localhost' identified by '123456';
(2)、远程登录:create user 'test'@'%' identified by '123456';
4、授权数据库"hy_miims_test"所有表的所有操作给test用户:
(1)、本地使用:grant all privileges on hy_miims_test.* to 'test'@'localhost';
(2)、远程使用:grant all privileges on hy_miims_test.* to 'test'@'%';
1.查看用户使用哪些数据库的权限:
show grants for develop@localhost;
2.查看用户所有权限
select user,host from mysql.user;
3.详情见:
https://blog.youkuaiyun.com/lu1171901273/article/details/91635417