• mysql_secure_installation


    安装完mysql-server 会提示可以运行mysql_secure_installation。运行mysql_secure_installation会执行几个设置:
      a)为root用户设置密码
      b)删除匿名账号
      c)取消root用户远程登录
      d)删除test库和对test库的访问权限
      e)刷新授权表使修改生效

    1、首先来进行 MySQL 的安装。打开超级终端,输入:

    [root@localhost ~]# yum install mysql mysql-server

    2、安装完毕,让 MySQL 能够随系统自动启动:

    [root@localhost ~]# chkconfig --levels 235 mysqld on

    [root@localhost ~]# /etc/init.d/mysqld start

    3、设置MySQL 数据 root 账户的密码:

    [root@localhost ~]# mysql_secure_installation

    当出现如下提示时候直接按回车:

    Enter current password for root

    出现如下再次回车:

    Set root password? [Y/n]

    出现如下提示输入你需要设置的密码,回车后在输入一次确认:

    New password:

    接下来还会有四个确认,分别是:

    Remove anonymous users? [Y/n]

    Disallow root login remotely? [Y/n]

    Remove test database and access to it? [Y/n]

    Reload privilege tables now? [Y/n]

    直接回车即可。

    4、重启mysql

    /etc/init.d/mysqld restart #重启

    /etc/init.d/mysqld stop #停止

    /etc/init.d/mysqld start #启动

  • 相关阅读:
    2020 11 21
    2020 11 20
    2020 11 19
    2020 11 18
    2020 11 17
    2020 11 16
    2020 11 15
    2020 11 14
    2020 11 14
    第五周学习进度报告
  • 原文地址:https://www.cnblogs.com/zhepama/p/4024004.html
Copyright © 2020-2023  润新知