1.创建数据库 CREATE DATABASE `tpcms` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci
2.查看数据库有多少用户 SELECT DISTINCT CONCAT('User: ''',user,'''@''',host,''';') AS query FROM mysql.user;
3.查看某个用户有什么权限 show grants for 'user'@'%';
4.创建user create user user identified by '123456';
5.给用户分配所有权限 grant all on *.* to 'user'@'%';
分配单个数据库访问权限 grant all privileges on test.* to 'user'@'%';