标签:
启动数据库服务 /etc/init.d/mysqld start
初始安全设置:
只保留一条允许root用户从本地连接的记录
delete from mysql.user where (user,host) not in (select ‘root‘,‘localhost‘);
将root用户名修改为system
update mysql.user set user=‘system‘,password=password(‘newpass‘) where user=‘root‘;
flush privileges;
消除test库权限隐患
truncate mysql.db;
show databases;
create database yyzc;
show create database yyzc;
drop database yyzc;
Grant方式创建用户:grant select@yyzc.* to test;
权限级别:
Mysql权限从大的粒度上分成5类:全局、数据库、表、列、程序
全局:grant create on *.* to test;
数据库:grant create on yyzc.* to test;
查看和收回权限:
查看权限show grants for test;
收回权限revoke create on *.* from test;
收回所有权限revoke all privileges, grant option from test
标签:
原文地址:http://www.cnblogs.com/cmss/p/4900176.html