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;

生产数据库上只需要有如上的帐户即可,其它的帐户可根据需求再作修改。

至此,生产库上的帐号管理权限安全配置告一段落。

转载于:https://www.cnblogs.com/zejin2008/p/4766572.html

Mysql数据库安全管理配置相关推荐

  1. mysql windows 管道连接,科技常识:Windows Server 2016 MySQL数据库安装配置详细安装教程...

    今天小编跟大家讲解下有关Windows Server 2016 MySQL数据库安装配置详细安装教程 ,相信小伙伴们对这个话题应该也很关注吧,小编也收集到了有关Windows Server 2016 ...

  2. 安装mysql 环境变量_win10系统安装mysql数据库后配置环境变量的图文教程

    安装mysql数据库后配置环境变量的图文教程: 1.同时按下键盘组合键Win+i,打开设置窗口,点击"System",进入系统设置: 2.在系统设置窗口中选择"About ...

  3. linux的mysql主主_Linux下指定mysql数据库数据配置主主同步的实例

    一. 概念:① 数据库同步  (主从同步 --- 主数据库写的同时 往从服务器写数据) ② 数据库同步  (主主同步 --- 两台数据库服务器互相写数据) 二. 举例 主主数据库同步服务器配置 数据库 ...

  4. ubuntu14.04使用MySQL数据库安装配置Hive 1.2.1

    ubuntu14.04使用MySQL数据库安装配置Hive 1.2.1 一.准备Mysql已经安装好.本人装的是navicat,图形化界面.     并在本地用root用户建立了test数据库   二 ...

  5. 《大型数据库技术》MySQL数据库安装配置及基础使用

    文章目录 1.下载安装MySQL 1.1 搜索MySQL下载页面 1.2 查看各种MySQL版本 1.3 安装配置MySQL 2.数据库基本操作 2.1 创建数据库 2.2 创建关系表 2.3 插入数 ...

  6. MySql数据库主从配置详细教程

    MySql数据库主从配置详细教程 本文将讲解mysql数据库的主从配置方法.mysql数据库进行主从配置后,可以实现数据库的备份.同时应用也可以实现读写分离,提高应用的并发量. 1.主从原理 主从原理 ...

  7. 转载 mysql 数据库优化配置实例

    MySQL服务器my.cnf配置文档详解  硬件:内存16G [client]  port = 3306  socket = /data/3306/mysql.sock [mysql]  no-aut ...

  8. [CentOS Python系列] 三.阿里云MySQL数据库开启配置及SQL语句基础知识

    从2014年开始,作者主要写了三个Python系列文章,分别是基础知识.网络爬虫和数据分析. Python基础知识系列:Pythonj基础知识学习与提升 Python网络爬虫系列:Python爬虫之S ...

  9. centos打开 mysql数据库文件_centos安装mysql数据库和配置mysql数据库

    mysql数据库安装 yum安装 1.下载rpm文件 yum locatinstall https://repo.mysql.com//mysql80-community-release-el7-1. ...

最新文章

  1. android webview开启html5支持
  2. 公司内部将多国语言key转换成中文javaScript
  3. 【编程题目】调整数组顺序使奇数位于偶数前面
  4. JavsScript与时间相关的函数
  5. maven可选依赖(Optional Dependencies)和依赖排除(Dependency Exclusions)
  6. 软件工程 / 为什么基于接口而非实现编程?
  7. c# 正则表达式 html标签,C#匹配HTML标签,正则表达式谁会?
  8. 信息学奥赛一本通C++语言——1009:带余除法
  9. 使用Weka进行数据挖掘
  10. VS code open in browser无法打开chrome浏览器的解决办法
  11. ubuntu20.04安装simhei字体--jupyter中文显示框框的解决方案
  12. 炫酷收徒技术网络网站源码
  13. 《嵌入式 - 深入剖析STM32》详解STM32时钟系统
  14. 揭开LiteOS的神秘面纱
  15. mac 锁屏及锁屏快捷键设置
  16. 服务器阵列卡维修费用,IBM服务器阵列卡损坏N种情况的解决的方法.doc
  17. 软件测试方法大全,49种测试方法,你知道几个?
  18. linux下分析webmail代码,Atmail Webmail Client多个HTML代码注入漏洞
  19. Wireshark抓包的妙用
  20. 济南大学计算机专业就业前景好,计算机进入“十大热门专业”,未来缺口大,这3所大学值得报考...

热门文章

  1. ARM的编程模式和7种模式
  2. SqliteHelper整理
  3. VisualStudio2010 SP1 SP1 SDK SQLServer 2008 SP3 下载地址
  4. C++ cin.sync()和cin.ignore()
  5. as转html5工具,将keras的h5模型转换为tensorflow的pb模型
  6. webservice生成客户端的方法
  7. Python较为经典的53个Python库
  8. Python应用实战-Clumper库 | Groupby具体案例用法
  9. 手把手教你用EVO工具评估SLAM数据集TUM、KITTI、EuRoC(附代码)
  10. linux查看apache配置文件路径,linux 命令行下查看apache配置文件httpd.conf位置