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!

标签:MySQL,安全问题,安装开始
0
投稿

猜你喜欢

  • 怎样取得局域网中所有SQL Server的实例

    2009-01-08 13:20:00
  • IronPython连接MySQL的方法步骤

    2024-01-27 05:43:05
  • 基于Python模拟浏览器发送http请求

    2023-01-11 22:22:05
  • 详解python调用cmd命令三种方法

    2022-05-09 09:01:21
  • python使用 request 发送表单数据操作示例

    2022-08-06 07:31:07
  • MySQL模式 Strict Mode知识点详解

    2024-01-27 20:50:41
  • python多进程下实现日志记录按时间分割

    2022-10-07 21:00:24
  • 论文查重python文本相似性计算simhash源码

    2023-02-05 18:11:35
  • Scrapy爬虫实例讲解_校花网

    2023-03-02 14:46:39
  • Go中sync 包Cond使用场景分析

    2024-01-31 20:50:05
  • Python实现机器学习算法的分类

    2023-08-31 05:50:36
  • 表单系列·出错字段排行榜

    2008-07-01 12:57:00
  • python中迭代器(iterator)用法实例分析

    2023-12-16 05:32:51
  • Python3使用pandas模块读写excel操作示例

    2021-06-30 16:34:47
  • Python如何生成exe文件?用Pycharm一步步带你学(超详细、超贴心)

    2023-09-08 04:46:20
  • Python获取图像中像素点坐标实例代码

    2021-02-20 19:42:05
  • python实现logistic分类算法代码

    2021-12-24 14:19:15
  • python实现数字炸弹游戏程序

    2021-09-29 18:44:24
  • 常见SQL Server 2000漏洞及其相关利用

    2007-10-01 14:45:00
  • 对比MySQL中int、char以及varchar的性能

    2024-01-22 13:17:52
  • asp之家 网络编程 m.aspxhome.com