MySQL的安全问题从安装开始说起
发布时间:2024-01-14 05:11:24
当你安装 MySQL 完后、会有个提示:
[root@localhost Desktop]# rpm -ivh MySQL-server-5.5.28-1.rhel5.i386.rpm
Preparing... ########################################### [100%]
1:MySQL-server ########################################### [100%]
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h localhost.localdomain password 'new-password'
Alternatively you can run:
/usr/bin/mysql_secure_installation
**对于这 2 种方式、我个人认为、mysql_secure_installation 比较好用***
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
**我觉得、这里的关键应该是能够把匿名用户给删掉***
See the manual for more instructions.
Please report any problems with the /usr/bin/mysqlbug script!
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 installationgo a bit smoother.
You should remove them before moving into a production environment
**匿名用户的危害****
所以、生产环境请务必删之!!
我选择 mysql_secure_installation
[root@localhost Desktop]# 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.
You already have a root password set, so you can safely answer 'n'.
Change the root password? [Y/n] n
... skipping.
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] n
... skipping.
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] n
... skipping.
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] y
... Success!
Cleaning up...
All done! If you've completed all of the above steps, your MySQL
installation should now be secure.
Thanks for using MySQL!


猜你喜欢
- Vue如何配置根目录@首先:@是在路径访问时使用的,为了减少层级引用。@这是webpack设置的路径别名,默认指向src。旧版本在build
- 简介本文分享的实例代码主要通过python语言实现批量替换页眉页脚的操作功能,具体如下。代码#!/usr/bin/env python# -
- 你同样可以使用cache标签来缓存模板片段。 在模板的顶端附近加入{% load cache %}以通知模板存取缓存标签。模板标签{% ca
- Select CONVERT(varchar(100), GETDATE(), 0): 05 16 2006 10:57AM Select
- 由于asp中是使用双引号作为字符串的开始和结束标志的,单一个字符串中的双引号出现次数大于两个时,程序就有可能运行错误。asp中是怎么输出引号
- Python的for循环十分灵活,使用for循环我们可以很轻松地遍历一个列表,例如:a_list = ['z', '
- 我就废话不多说了,直接上代码吧!from time import sleepfrom threading importThreadimpor
- PyQt5数据拖曳Drag与Drop介绍为用户提供的拖曳功能很直观,在很对桌面应用程序中,复制或移动对象都可以通过拖曳来完成基于MIME类型
- 三种方法:①直接使用dict②使用defaultdict③使用Counter ps:`int()`函数默认返回0 ①di
- 基本介绍环境: Python 3.5+, Pytorch 0.4.1/1.0.0安装:pip install pytorch-pretrai
- 一般情况下,tensorflow里面变量初始化过程为: #variables ........... #......
- Django Model的外键自关联在django的model定义中,有时需要某个Field引用当前定义的Model,比如一个部门(Depa
- python删除某个目录文件夹及文件的方法:#!/usr/bin/env pythonimport osimport shutildelLi
- 在程序运行的过程中,如果发生了错误,可以事先约定返回一个错误代码,这样,就可以知道是否有错,以及出错的原因。在操作系统提供的调用中,返回错误
- 使用python实现文件导入,具体方法如下:文件样例可以自己random这里的temp1根据每一行的分隔符来读入,‘\n'表述回车t
- 学用python也有3个多月了,用得最多的还是各类爬虫脚本:写过抓代理本机验证的脚本,写过在discuz论坛中自动登录自动发贴的脚本,写过自
- 什么是类,对象,实例,类## 标题变量(类属性),实例变量(实例属性)面向对象编程(Object-oriented Programming,
- 在web运行中很重要的一个功能就是加载静态文件,在django中可能已经给我们设置好了,我们只要直接把模板文件放在templates就好了,
- 双击编辑功能如何实现:例如:标题 (鼠标双击“标题”文字 即出现可编辑的输入框形式及提交按钮) <!D
- 本文实例讲述了在Python中模仿POST HTTP数据及带Cookie提交数据的实现方法,分享给大家供大家参考。具体实现方法如下:方法一如