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. RPC和NFS

    参考:http://eduunix.ccut.edu.cn/index2/html/linux/OReilly.SUSE.Linux.Jul.2006/059610183X/suselinux-CHP ...

  2. libevent 安装异常

    有homebrew的可以使用 1 brew install memcached 这个命令来安装没有homebrew的可以直接手动安装1.去官网http://memcached.org/下载最新的包,然 ...

  3. zookeeper节点Watch机制实例展示

    znode以某种方式发生变化时,“观察”(watch)机制可以让客户端得到通知.可以针对ZooKeeper服务的“操作”来设置观察,该服务的其他 操作可以触发观察. 实现Watcher,复写proce ...

  4. javascript一种新的对象创建方式-Object.create()

    1.Object.create() 是什么? Object.create(proto [, propertiesObject ]) 是E5中提出的一种新的对象创建方式,第一个参数是要继承的原型,如果不 ...

  5. mysql性能监控工具:mycheckpoint的使用方法

    mycheckpoint 是针对mysql的一个性能监控.指标采集的python写成的工具. 工作原理说明: mycheckpoint是一段脚本,通过将其设置为crontab定时任务,每几分钟采集一次 ...

  6. Web - 客户端存储的几种方式

    客户端存储主要方便一些APP离线使用.今天就来说说客户端存储的方法有多少? 说在最前面的一句:所有的客户端存储都有一个原则:读写的数据必须要同域 1 Cookie Cookie是一项很老的技术的,就是 ...

  7. 【转帖】自助式BI的崛起:三张图看清商业智能和大数据分析市场趋势

    自助式BI的崛起:三张图看清商业智能和大数据分析市场趋势 大数据时代,商业智能和数据分析软件市场正在经历一场巨变,那些强调易用性的,人人都能使用的分析软件正在取代传统复杂的商业智能和分析软件成为市场的 ...

  8. Generating a new ASP.NET session in the current HTTPContext

    void regenerateId() { System.Web.SessionState.SessionIDManager manager = new System.Web.SessionState ...

  9. algo_预备

    章 C + +程序设计 大家好!现在我们将要开始一个穿越" 数据结构.算法和程序" 这个抽象世界的特殊旅程,以解决现实生活中的许多难题.在程序开发过程中通常需要做到如下两点:一是高 ...

  10. dsoframer控件学习小结(打开WORD,EXCEL等文件)

    根据自己对dsoframer控件的学习,想把dsoframer控件进行简单的包装为C#的usercontrol,大体需要作如下:(创建windows的usercontrol的步骤就不再说了...)我们 ...