mysql_secure_installation 安全安装(用于生产环境设置)
编译安装完mysql5.6,如果用于生产环境,最好执行mysql_secure_installation来做一些常规化安全设置。
需要提前将~mysql/bin加入环境变量
/apps/mysql//bin/mysql_secure_installation
------------->

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MySQL to secure it, we'll need the current
password for the root user. If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none):

提示输入密码,没有密码就直接回车

OK, successfully used password, moving on... Setting the root password ensures that nobody can log into the MySQL root user without the proper authorisation. Set root password? [Y/n]

提示设置root user密码 Y

New password: Re-enter new password: Password updated successfully! Reloading privilege tables.. ... Success! By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. Remove anonymous users? [Y/n]

生产环境建议删除系统创建的匿名用户 Y

... Success! Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. Disallow root login remotely? [Y/n]

禁止root用户远程登录 Y

By default, MySQL comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? [Y/n]

删除test数据库 Y

- Dropping test database... ... Success! - Removing privileges on test database... ... Success! Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? [Y/n]

重载权限表 Y

... Success! All done! If you've completed all of the above steps, your MySQL installation should now be secure. Thanks for using MySQL! Cleaning up...

完成~~~
完成后空密码已经无法登录
# mysql
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
mysql> select user,host from mysql.user;
+-------+-----------+
| user | host |
+-------+-----------+
| root | 127.0.0.1 |
| root | ::1 |
| root | localhost |
+-------+-----------+
4 rows in set (0.01 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
+--------------------+
3 rows in set (0.00 sec)
mysql_secure_installation 安全安装(用于生产环境设置)的更多相关文章
- 基于redis的分布式锁(不适合用于生产环境)
基于redis的分布式锁 1 介绍 这篇博文讲介绍如何一步步构建一个基于Redis的分布式锁.会从最原始的版本开始,然后根据问题进行调整,最后完成一个较为合理的分布式锁. 本篇文章会将分布式锁的实现分 ...
- Python 2/3 安装与运行环境设置
Python 2/3 安装与运行环境设置: 1.Python 软件源:https://www.python.org/ 下载Win版本 https://www.python.org/downloa ...
- windows下安装python、环境设置、多python版本的切换、pyserial与多版本python安装、windows命令行下切换目录
1.windows下安装python 官网下载安装即可 2.安装后的环境设置 我的电脑--属性--高级--设置path的地方添加python安装目录,如C:\Python27;C:\Python33 ...
- Windows10内置ubuntu子系统安装后中文环境设置
原文:Windows10内置ubuntu子系统安装后中文环境设置 第一开启相关设置,使用小娜(Win键+c)直接查找关键字打开更快. ①设置→查找"针对开发人员"→开发人员模式 ...
- (转)centos 7 Tomcat 8.5 的安装及生产环境的搭建调优
原文:https://www.cnblogs.com/linhankbl/articles/9149804.html#top JVM菜鸟进阶高手之路七(tomcat调优以及tomcat7.8性能对比) ...
- 结合Git实现Mysql差异备份,可用于生产环境
埋头苦干多年一直没写过文章,今天突发狂想,为LNMP阵营贡献一些力量.就从平时工作过程中的心得和一些技巧分享出来.今天就猿们最熟悉的Mysql开始宅鸟的开篇博客文章.欢迎猿们拍砖.转载. 注意:宅鸟的 ...
- Ocelot中文文档-Raft(实验功能不能用于生产环境)
Ocelot最近整合了Rafty,这是我在去年一直研究的Raft的一个实现. 这个项目实验性非常强,所以在我认为它没问题之前,请不要在生产环境中使用Ocelot的这个功能. Raft是一种分布式一致性 ...
- redis 编译安装(生产环境推荐)
一.安装redis 1.下载redis包 wget http://download.redis.io/releases/redis-3.2.1.tar.gz 2.解压redis包到/opt下 tar ...
- 8 个用于生产环境的 SQL 查询优化调整
在没有数据仓库或单独的分析数据库的组织中,报告的唯一来源和最新的数据可能是在现场生产数据库中. 在查询生产数据库时,优化是关键.一个低效的查询可能会对生产数据库产生大量的资源消耗,如果查询有错误会引发 ...
随机推荐
- cf 525D.Arthur and Walls
判断2*2的正方形,是不是3个"."1个"*"然后暴力bfs就好.(这种处理也是挺神奇的2333%%题解) #include<bits/stdc++.h& ...
- 服务器搭建---Linux安装Node.js
先去官网下载:https://nodejs.org/en/download/ 把压缩包上传到服务器的/usr/local/soft(博主习惯)文件夹下 解压文件: cd /usr/local/sof ...
- 寒假day24
数据挖掘得继续深入,人物画像需要进行更多层次的分析
- great vision|be quite honest with you
won a national championship拿到全国冠军 come play for you参加你的队伍 Really not true事实并非如此 Being the Socratic p ...
- gabor滤波器
https://blog.csdn.net/u013709270/article/details/49642397 https://github.com/xuewenyuan/Gabor_Visual ...
- MySql 的操作指令(window)
1.登录: mysql -uroot -p 2.查看所有数据库: show databases 3.切换数据库 : use databasename(数据库名称) 4.查看数据库的所有表格 ...
- Cookie API和记录上次来访时间
1.什么是Cookie? Cookie是一种会话技术,用千将会话过程中的数据保存到用户的浏览器中,从而使浏览器和服务器可以更好地进行数据交互. 在现实生活中,当顾客在购物时,商城经常会赠送顾客一张会员 ...
- 74)搭建TCP服务器
补充: 1-->listen是监听,就是监听你建立的那个socket那个窗口,要是有客户端来了,那么就把他加到 队列里面,然后accept是从队列中取客户端(就是把对应的客人的信息拿过来,交给w ...
- 吴裕雄--天生自然 JAVASCRIPT开发学习:函数定义
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...
- SQL基础教程(第2版)第3章 聚合与排序:3-3 为聚合结果指定条件
第3章 聚合与排序:3-3 为聚合结果指定条件 ● 使用COUNT函数等聚合函数对表中数据进行汇总操作时,为其指定条件的不是WHERE子句,而是HAVING子句.● 聚合函数可以在SELECT子句. ...