我们要注意的Mysql基本安全设置
2015-05-19 23:07
309 查看
1.设置或修改Mysql root密码:
默认安装后空密码,以mysqladmin命令设置密码:
Mysql命令设置密码:
更改密码:
2.删除默认的数据库和用户
3. 更改默认root账号名称:
4. 本地文件安全:
5. 禁止远程连接mysql,远程管理可通过phpmyadmin,编辑my.cnf在[mysqld]添加:
6.最小权限用户:
7. 限制普通用户浏览其它数据库,编辑my.cnf在[mysqld]添加:
8.快速修复MySQL数据库
修复数据库
修复指定的数据库
9.跟据内存的大小选择MySQL的配置文件:
默认安装后空密码,以mysqladmin命令设置密码:
mysqladmin -uroot password "password"
Mysql命令设置密码:
mysql> set password for root@localhost=password('password);
更改密码:
update mysql.user set password=password('password') where user='root'; flush privileges;
2.删除默认的数据库和用户
drop database test; use mysql; delete from db; delete from user where not(host="localhost" and user="root"); flush privileges;
3. 更改默认root账号名称:
update mysql.user set user="admin" where user="root"; flush privileges;
4. 本地文件安全:
set-variable=local-infile=0
5. 禁止远程连接mysql,远程管理可通过phpmyadmin,编辑my.cnf在[mysqld]添加:
skip-networking
6.最小权限用户:
create database db1; grant select,insert,update,delete,create,drop privileges on database.* to user@localhost identified by 'passwd';
7. 限制普通用户浏览其它数据库,编辑my.cnf在[mysqld]添加:
--skip-show-database
8.快速修复MySQL数据库
修复数据库
mysqlcheck -A -o -r -p
修复指定的数据库
mysqlcheck -o -r database -p
9.跟据内存的大小选择MySQL的配置文件:
my-small.cnf # > my-medium.cnf # 32M - 64M my-large.cnf # memory = 512M my-huge.cnf # 1G-2G my-innodb-heavy-4G.cnf # 4GB
相关文章推荐
- mysql基本安全设置(转PS:最近在做php开发学习下后台)
- centos下mysql基本安全设置
- 对MySQL中字符集的相关设置操作的基本教程
- 对MySQL中字符集的相关设置操作的基本教程
- [head first php&mysql]读书笔记-基本的安全信息(第五章)
- mySql基本设置
- linux安装后的基本调优和安全设置
- MySQL的一些安全注意点
- 微信开发基本设置注意
- 写给自己看的Linux运维基础(二) - Apache/MySQL. 安全设置. 定时任务
- iis 设置,安全设置,基本设置
- Mysql的两个安全设置
- Windows Server 2003 服务器上线后的的基本安全设置
- 网站服务器基本安全设置
- MySQL基本命令行&MySql外键设置详解
- 注意阿里云服务器的安全组设置情况
- mysql的安全设置(防sql注入)
- 关于Mysql字段属性的基本设置