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数据库安全管理配置的更多相关文章

  1. 在Eclipse中使用JDBC访问MySQL数据库的配置方法

    在Eclipse中使用JDBC访问MySQL数据库的配置方法 分类: DATABASE 数据结构与算法2009-10-10 16:37 5313人阅读 评论(10) 收藏 举报 jdbcmysql数据 ...

  2. jmeter中通过jdbc方式连接mysql数据库的配置参考

    jmeter中通过jdbc方式连接mysql数据库的配置参考: Database URL=jdbc:mysql://ip:port/dbname?useUnicode=true&allowMu ...

  3. mac安装mysql数据库及配置环境变量

    mac安装mysql数据库及配置环境变量 mac安装mysql数据库及配置环境变量 原文文链接:https://blog.csdn.net/qq_36004521/article/details/80 ...

  4. [转帖]mysql数据库主从配置

    mysql数据库主从配置 https://www.toutiao.com/i6680489302947791371/ 多做实验 其实挺简单的 很多东西 要提高自信 去折腾. 架构与我 2019-04- ...

  5. Centos6.4下Yum命令安装Mysql数据库及配置

    如果要在Linux上做j2ee开发,首先得搭建好j2ee的开发环境,包括了jdk.tomcat.eclipse的安装(这个在之前的一篇随笔中已经有详细讲解了 如果要开发web项目,我们当然可以安装一个 ...

  6. Mysql数据库基本配置

    一 数据库基本配置包括编码方式 (安装环境是在linux下) 1.1 进入数据库 开启数据库服务:service mysqld start/restart(如果开启话可以重启) 关闭数据库服务:ser ...

  7. Mysql数据库主从配置

    一.为什么要使用数据库主从架构 一个网站损耗资源最厉害的就是数据库,最易崩溃的也是数据库,而数据库崩溃带来的后果是非常严重的.数据库分为读和写操作,在实际的应用中,读操作的损耗远比写操作多太多,因此读 ...

  8. Django中把SQLite数据库转换为Mysql数据库的配置方法

    我们在学习和开发Django的时候,一般是使用SQLite作为数据库.在正式讲网站部署上线是用MySQL数据库比较多.MySQL支持高并发的访问,而且相对于SQLite,MySQL性能更好.下面讲讲如 ...

  9. MySQL数据库的配置

    一.配置MySQL数据库 MySQL的官网www.mysql.com 1.解压绿色版mysql,并改名为mysql5.7,如下图 对比一下下图5.6以前的版本,少data目录(存放数据)和my-def ...

随机推荐

  1. 奇怪吸引子---Rucklidge

    奇怪吸引子是混沌学的重要组成理论,用于演化过程的终极状态,具有如下特征:终极性.稳定性.吸引性.吸引子是一个数学概念,描写运动的收敛类型.它是指这样的一个集合,当时间趋于无穷大时,在任何一个有界集上出 ...

  2. LCLFramework框架 1.1 Pre-Alpha 源码公布

    使用开发框架的好处:1.框架在技术上为软件系统提供了完整的模式实践2.框架为团队提供了合理可行的软件开发过程模式3.框架的应用大大提高了团队的开发效率,团队只需要关注与领域相关的业务实现,而无需关注具 ...

  3. LeetCode: Convert Sorted List to Binary Search Tree 解题报告

    Convert Sorted List to Binary Search Tree Given a singly linked list where elements are sorted in as ...

  4. 前端经常使用插件使用文档 以及demo

    watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/ ...

  5. 关于mvc、webapi中get、post、put、delete的参数

    webapi中post提交的数据必须是一个类,get提交的数量无所谓 多种参数get时,参数名不能相同: 在能通过c#的校验的前提下,参数名.参数数量不能全完相同 public string Get( ...

  6. WinDbg 命令集锦

    //断点相关 bp + 地址 设置断点bl  显示已经设定的断点bu + 地址 设置断点,但是这种类型断点再下一次启动时被记录bc 清除断点对于断点范围,可以用*匹配,-表示一个范围,表达多个可用,号 ...

  7. thinkphp的伪静态化

    1. 设置默认的控制器和模块 // 绑定访问Admin模块 define('BIND_MODULE','Home'); // 绑定访问Index控制器 define('BIND_CONTROLLER' ...

  8. [论文笔记] 一种Java遗留系统服务化切分和封装方法 (计算机学报, 2009)

    李翔,怀进鹏,曾晋,高鹏. 一种Java遗留系统服务化切分和封装方法. 计算机学报, 32(9), 2009, p1084-1815 (gs:5) 1. 本文研究从Java遗留系统中切分并封装出Web ...

  9. WIN8 下Cisco VPN连接 出现vpn 422 failed to enable virtual adapter错误

    今天在家用VPN软件连接,出现了“vpn 422 failed to enable virtual adapter”的错误,系统安装的是Win8专业版32位,百度了半天又很多方法解决不了,后来发现了一 ...

  10. 使用Javascript来创建一个响应式的超酷360度全景图片查看幻灯效果

    360度的全景图片效果常常可以用到给客户做产品展示,今天这里我们推荐一个非常不错的来自Robert Pataki的360全景幻灯实现教程,这里教程中将使用javascript来打造一个超酷的全景幻灯实 ...