`
maozilee
  • 浏览: 246567 次
  • 性别: Icon_minigender_1
  • 来自: 长沙
社区版块
存档分类
最新评论

mysql_secure_installation

阅读更多

  打开终端,输入:

 yum install mysql mysql-server

  然后为MySQL创建系统启动链接(这样在系统启动时,MySQL会自动启动),在终端输入命令:

 chkconfig --levels 235 mysqld on

/etc/init.d/mysqld start

  为MySQL root帐户设置密码:

   mysql_secure_installation

  终端显示,按照提示操作:

  

[root@server1 ~]# 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] <– 回车
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] <– 回车
… 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] <–回车
… Success!

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] <– 回车
- 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] <– 回车
… 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!

[root@server1 ~]#

 

分享到:
评论

相关推荐

    MySQL安全配置向导mysql_secure_installation详解

    安装完mysql-server 会提示可以运行mysql_secure_installation。运行mysql_secure_installation会执行几个设置:  a)为root用户设置密码  b)删除匿名账号  c)取消root用户远程登录  d)删除test库和对test库的...

    MySQL安装和密码重置.pdf

    如何使用mysql_secure_installation进行MySQL安全设置:mysql_secure_installation是一个MySQL脚本,可帮助您执行常见的安全设置,例如禁用匿名用户、删除测试数据库等。 这些资源应该涵盖了MySQL

    linux在非root下安装mysql

    本人在网上查询了好多资料,经过两天的实验终于得出正确的安装步骤。安装步骤: 查询以前安装的mysql相关包 rpm -qa | grep mysql 暴力删除这个包 rpm -e mysql-libs-5.1.66-2... /usr/bin/mysql_secure_installation

    MySQL 5.6.25 源码包+安装方法 (mysql-5.6.25.tar.gz)

    - 自动设置:# ./bin/mysql_secure_installation 或 - 手动置:# ./bin/mysqladmin -u root password '&lt;PASSWORDHERE&gt;' ------------------ 操作详情参看: ...

    centos7安装mysql

    在CentOS 7上安装MySQL可以按照...mysql_secure_installation 按照提示设置root密码、移除匿名用户、禁止远程root登录等安全设置。 验证MySQL是否成功安装。执行以下命令验证MySQL是否正常运行: systemctl status m

    MySQL的安装配置教程详细讲解.docx

    sudo mysql_secure_installation 该脚本将提示您进行一些安全性设置,如设置root密码、删除匿名用户等。 5. 登录MySQL: bash Copy code mysql -u root -p 输入刚刚设置的root密码。 在Windows上安装MySQL: 1. ...

    Mysql安装包for linux.zip

    1.把压缩包上传到linux服务器并解压 2.使用rpm命令安装mysql服务 ... /usr/bin/mysql_secure_installation 6.测试登录运行Mysql mysql -u root -p 7.mysql常用命令 show databases; use xxx; show tables;

    CentOS 7.0编译安装cmake和mysql安装包

    一、安装MySQL 1、安装cmake cd /usr/local/src tar zxvf cmake-2.8.11.2.tar.gz cd cmake-2.8.11.2 ./configure ...mysql_secure_installation #设置Mysql密码,根据提示按Y 回车输入2次密码

    CentOS8服务器安装Mysql并设置远程连接

    过程 安装 1、通过以下命令,使用最新的包管理器安装MySQL(安装过程中一直yes/y即可) sudo dnf install @...4、运行mysql_secure_installation脚本,进行密码设置、允许远程连接等安全性设置。 sudo mysql_secure_

    seafile安装步骤.txt

    mysql_secure_installation #安装依赖 yum install -y python-memcached \ python-ldap \ python-urllib3 \ python-imaging \ MySQL-python \ python-distribute \ ffmpeg \ ffmpeg-devel ...

    MySql 8.0.11安装配置教程

    目前MySQL8.0.11社区版提供了多种多样的安装方式,但是并未发现针对Linux Generic安装包包含的mysql_secure_installation的安装说明。 因此这里使用推荐的RPM安装: 一、mysql-8.0.11-1.el6.x86_64.rpm-bundle.tar...

    MYSQL-python-scripts:如何在Linux服务器上安装MYSQL并使用Python脚本来管理数据库

    MYSQL-Python-脚本 如何在Linux服务器上安装... sudo mysql_secure_installation Morteza123 @ $ 测试MySQL是否正在运行 systemctl status mysql.service 步骤1:启动MySQL Shell sudo mysql 测试SSH是否正在运行

    AIX基本环境搭建.doc

    ./bin/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...

    centos 7.5 安装zabbix4.0

    `mysql_secure_installation` 创建zabbix数据库 `mysql -uroot -p` `create database zabbix character set utf8 collate utf8_bin;` `grant all privileges on zabbix.* to zabbix@localhost identified by ...

    bitwarden_rs_rpm

    bitwarden_rs RPM软件包安装安装并启动mariadb: yum install mariadb-serversystemctl start mariadbsystemctl enable mariadb安全mariadb安装: mysql_secure_installation创建位域数据库: echo "create database...

    MySQL 5.6 Reference Manual

    Table of Contents Preface, Notes, Licenses . . . . . . . . ....1. Licenses for Third-Party Components ....1.1. FindGTest.cmake License ....1.2. LPeg Library License ....1.3. LuaFileSystem Library License ....

    详解如何在Linux中重置MySQL或者MariaDB的root密码

    如果你是第一次设置 MySQL 或 MariaDB 数据库,你可以直接运行 mysql_secure_installation 来实现基本的安全设置。 其中一项是设置数据库 root 帐户的密码 – 你必须保持私密,并仅在绝对需要时使用。如果你忘记了...

    投资组合:我的开发人员投资组合。 用Laravel制成

    关于这个项目 这是我的开发人员投资组合网站。 通过这个项目,我正在练习自己的技能并扩展我的Laravel知识。...sudo mysql_secure_installation 然后 git clone https://github.com/jfajardo5/portfol

Global site tag (gtag.js) - Google Analytics