Mysql数据库安全管理配置
1.删除test库
原因:
The default MySQL installation comes with a database named test that anyone can access. This database is intended only for tutorials, samples, testing, etc. Databases named "test" and also databases with names starting with - depending on platform - "test" or "test_" can be accessed by users that do not have explicit privileges granted to the database. You should avoid such database names on production servers.
建议:
Drop databases named "test" and also all databases with names starting with - depending on platform - "test" or "test_" and remove all associated privileges.
具体操作:在主库上删除test库:
drop database test;
2. 删除root用户或者让root用户只可在本机登陆
原因:
The root User can log in remotely. It means that you can connect as root from remote hosts if you know the password. An attacker must guess the password, but may attempt to do so by connecting from remote hosts. However, if remote access is disallowed, the attacker can attempt to connect as the root user only after first gaining access to localhost.
The default MySQL installation includes a root account with super (full) privileges that is used to administer the MySQL server. The name root is created by default and is very well known. The literal value root does not have any significance in the MySQL privilege system. Hence there is no requirement to continue with the user name root.
建议:
a. rename the root mysql user to something obscure and disallow remote access (best for security).
b. if you still want to keep the root user for some reason, make sure remote access is disallowed. use the following sql: delete from mysql.user where user = "root" and host not in ('127.0.0.1','localhost',);flush privileges;
具体操作:
delete from mysql.user where user = "root" and host not in ('127.0.0.1','localhost',);
flush privileges;
在做删除root用户此步骤前需要依次确认 function、procedure、event、view、trigger的definer,如果有definer为root@%或root@xxx需要将之改为root@127.0.0.1或root@localhost,而且root@localhost或root@127.0.0.1需要被保留,除非将definer也改为其它。要不然在执行相应的定义时会拒绝执行。具体修改见《mysql如何修改所有的definer》
3.最小化生产库上的用户权限
准备用common_user来联接数据库,保留root的本地登陆,授权一个具有dba权限的新帐户:
grant insert,delete,update,select,execute on sp.* to 'common_user'@'127.0.0.1' identified by 'xxxxxx';
grant insert,delete,update,select,execute on sp.* to 'common_user'@'%' identified by 'xxxxxx';
grant all on *.* to ‘dba’@‘%’ identified by ‘xxxxxx’ with grant option;
flush privileges;
生产数据库上只需要有如上的帐户即可,其它的帐户可根据需求再作修改。
至此,生产库上的帐号管理权限安全配置告一段落。
Mysql数据库安全管理配置的更多相关文章
- 在Eclipse中使用JDBC访问MySQL数据库的配置方法
在Eclipse中使用JDBC访问MySQL数据库的配置方法 分类: DATABASE 数据结构与算法2009-10-10 16:37 5313人阅读 评论(10) 收藏 举报 jdbcmysql数据 ...
- jmeter中通过jdbc方式连接mysql数据库的配置参考
jmeter中通过jdbc方式连接mysql数据库的配置参考: Database URL=jdbc:mysql://ip:port/dbname?useUnicode=true&allowMu ...
- mac安装mysql数据库及配置环境变量
mac安装mysql数据库及配置环境变量 mac安装mysql数据库及配置环境变量 原文文链接:https://blog.csdn.net/qq_36004521/article/details/80 ...
- [转帖]mysql数据库主从配置
mysql数据库主从配置 https://www.toutiao.com/i6680489302947791371/ 多做实验 其实挺简单的 很多东西 要提高自信 去折腾. 架构与我 2019-04- ...
- Centos6.4下Yum命令安装Mysql数据库及配置
如果要在Linux上做j2ee开发,首先得搭建好j2ee的开发环境,包括了jdk.tomcat.eclipse的安装(这个在之前的一篇随笔中已经有详细讲解了 如果要开发web项目,我们当然可以安装一个 ...
- Mysql数据库基本配置
一 数据库基本配置包括编码方式 (安装环境是在linux下) 1.1 进入数据库 开启数据库服务:service mysqld start/restart(如果开启话可以重启) 关闭数据库服务:ser ...
- Mysql数据库主从配置
一.为什么要使用数据库主从架构 一个网站损耗资源最厉害的就是数据库,最易崩溃的也是数据库,而数据库崩溃带来的后果是非常严重的.数据库分为读和写操作,在实际的应用中,读操作的损耗远比写操作多太多,因此读 ...
- Django中把SQLite数据库转换为Mysql数据库的配置方法
我们在学习和开发Django的时候,一般是使用SQLite作为数据库.在正式讲网站部署上线是用MySQL数据库比较多.MySQL支持高并发的访问,而且相对于SQLite,MySQL性能更好.下面讲讲如 ...
- MySQL数据库的配置
一.配置MySQL数据库 MySQL的官网www.mysql.com 1.解压绿色版mysql,并改名为mysql5.7,如下图 对比一下下图5.6以前的版本,少data目录(存放数据)和my-def ...
随机推荐
- mac os x安装ngigx+php fastcgi+mysql+memcache详细流程
Part 1: MacPorts Mac上装软件常用的是MacPorts和homebrew,这个软件会很方便地提供软件的安装.装这些前先得装Xcode,Xcode在appstore上有,一个多G,下载 ...
- mysql设置连接超时时间参数:wait_timeout
[root@ ~]# mysql -h 192.168.0.* -uroot -pEnter password: Welcome to the MySQL monitor. Commands end ...
- 当创业遇上O2O,新一批死亡名单,看完震惊了!
当创业遇上O2O,故事就开始了,总投入1.6亿.半年开7家便利店.会员猛增至10万……2015半年过去后,很多故事在后面变成了一场创业“事故”,是模式错误还是烧钱过度?这些项目的失败能给国内创业者带来 ...
- Road to the future——伪MVVM库Q.js
模仿Vuejs的伪MVVM库,下面是使用说明 项目地址:https://github.com/miniflycn/Q.js 相关项目:https://github.com/miniflycn/Ques ...
- jquery获取元素的值,获取当前对象的父对象等等
jsp代码: <span><input type="hidden" value="1" id="newInfo">& ...
- 演化理解 Android 异步加载图片
原文:http://www.cnblogs.com/ghj1976/archive/2011/05/06/2038738.html#3018499 在学习"Android异步加载图像小结&q ...
- bss段和data段的区别
一般情况下,一个程序本质上都是由 bss段.data段.text段三个组成的——本概念是当前的计算机程序设计中是很重要的一个基本概念.而且在嵌入式系统的设计中也非常重要,牵涉到嵌入式系统运行时的内存大 ...
- TokuDB调研文档
另见链接:http://note.youdao.com/share/?id=77dd1e9cc139b57586665f702467c56a&type=note 安装 安装主要包括两种方法 ...
- repo andrid
http://www.cnblogs.com/bluestorm/p/4419135.html
- C# WinForm程序打印条码 Code39码1
做WinForm程序需要打印条码,为了偷懒不想自己写生成条码的程序在网上下载一个标准的39码的字体,在程序里面换上这个条码字体即可打印条码了. 最重要的一点作为记录: 如果想把“123456789”转 ...