当前位置:  数据库>mysql

MySQL的安全问题从安装开始说起

    来源: 互联网  发布时间:2014-10-08

    本文导语:  当你安装 MySQL 完后、会有个提示:[root@localhost Desktop]# rpm -ivh MySQL-server-5.5.28-1.rhel5.i386.rpmPreparing... ########################################### [100%]1:MySQL-server ########################################### [100%]PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root ...

当你安装 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!


    
 
 

您可能感兴趣的文章:

  • php安装完成后如何添加mysql扩展
  • 为什么用linux安装盘安装了mysql后,启动mysql,提示找不到mysql.sock文件?
  • MySQL Workbench的下载安装与使用教程
  • 我已经用源代码方式安装了apache,如何让它支持php和mysql(php没有安装,mysql安装的是rpm包),要不要重新安装apache?如何删除已有的ap
  • php中内置的mysql数据库连接驱动mysqlnd简介及mysqlnd的配置安装方式
  • php for linux安装既不支持mysql.如何配置支持mysql
  • Win7 64位下mysql 下载、安装与配置图文教程
  • 在Linux内安装了Mysql,无法进入Mysql.
  • mysql 5.7下载安装配置详细教程
  • 在free bsd unix下安装mysql,都需要装什么,还需dbd:mysql?
  • mysql安装图解
  • linux下安装mysql 我选的默认路径,为什么找不到/usr/local/mysql
  • mysql数据库下载安装教程和使用技巧
  • 出学者问题:我安装了MySql,但我不知道安装到何处去了,又该如何启动服务?
  • 完全安装redhat7.2后,默认的mysql安装目录是什么?
  • 请问红旗Linux下,安装Mysql时,应该下载mysql 的哪一种rpm包?谢谢
  • 我的是mandrake8.2,已经安装了mysql,请教一个菜鸟问题,怎么操作才能进入mysql,然后建库!
  • 请问as4 u4安装时选择SQL数据库包,是不是还是没有把mysql安装上???谢谢!!
  • debian 安装mysql之后再安装libc6-dev出现问题
  • 安装好的Redhat Linux 8.0,带Apache和php支持,安装上Mysql后,运行正常,但检测提示php不支持Mysql,如何解决?
  • 系统安装的时候选了mysql,但是在setup里面找不到mysql的服务,进程还是有的,但是启动不了。
  •  
    本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
    本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。












  • 相关文章推荐
  • 详解MySQL中DROP,TRUNCATE 和DELETE的区别实现mysql从零开始
  • Mysql auto_increment 重新计数(让id从1开始)
  • mysql中如何查看最大连接数(max_connections)和修改最大连接数
  • 在 linux下输入"mysql"命令,进入mysql命令行,但出现“Can't connetc to local MySQL server thuough socket /var/lib/mysql/mysql.sock
  • Mysql查询错误:ERROR:no query specified原因
  • MySQL 重装MySQL后, mysql服务无法启动
  • mysql中查询当前正在运行的SQL语句并找出mysql中运行慢的sql语句
  • 請教,在redhat linux7.2+mysql 中,系統提示mysql已啟動,網頁卻不能訪問mysql?
  • 在 linux下输入"mysql"命令,进入mysql命令行,但出现“Can't connetc to local MySQL server thuough socket /var/lib/mysql/mysql.sock iis7站长之家
  • 求解释: useradd -g mysql mysql -d /home/mysql -s /sbin/nologin
  • VS2012+MySQL+SilverLight5的MVVM开发模式介绍
  • 怎样在linux终端输入mysql直接进入mysql?
  • MySQL索引基本知识
  • c++中关于#include <mysql/mysql.h>的问题?
  • Mysql设置查询条件(where)查询字段为NULL
  • mysql -u root mysql 怎么解释
  • mysql中字符串和时间互相转换的方法(自动转换及DATE_FORMAT函数)
  • mm.mysql那里可以下载?www.mysql.com根本下载不了。谢谢了
  • java将类序列化并存储到mysql(使用hibernate)
  • MySQL集群 MySQL Cluster
  • Mysql索引类型:B-Tree索引介绍
  • MySQL存储引擎 MySQL Maria
  • Mysql Select查询执行流程介绍及实例
  • linux 下mysql 以root和普通用户进入mysql的问题


  • 站内导航:


    特别声明:169IT网站部分信息来自互联网,如果侵犯您的权利,请及时告知,本站将立即删除!

    ©2012-2021,,E-mail:www_#163.com(请将#改为@)

    浙ICP备11055608号-3