• CentOS-64位安装mysql5.7


    1.前言

    因为直接使用yum install默认安装的版本是5.1,查阅官网后使用Yum Repository安装mysql5.7,这里下载的版本是mysql57-community-release-el6-11.noarch.rpm。

    2.安装

    1)添加yum repository

    [root@localhost opt]# sudo yum localinstall mysql57-community-release-el6-11.noarch.rpm
    [root@localhost opt]# yum repolist enabled | grep "mysql.*-community.*"

    2)安装mysql

    1 [root@localhost /]# sudo yum install mysql-community-server

    3)启动mysql及查看服务

    1 [root@localhost /]# service mysqld start
    2 Initializing MySQL database:                               [  OK  ]
    3 Installing validate password plugin:                       [  OK  ]
    4 Starting mysqld:                                           [  OK  ]
    5 [root@localhost /]# sudo service mysqld status
    6 mysqld (pid  42363) is running...

    4)修改密码

    因mysql有默认密码,先生成临时密码,登录mysql后再修改密码。

    1 [root@localhost /]# sudo grep 'temporary password' /var/log/mysqld.log
    2 2017-06-27T15:19:54.431342Z 1 [Note] A temporary password is generated for root@localhost: InA1Mppj%R1K

    登录mysql

    1 [root@localhost /]# mysql -uroot -p
    2 Enter password: 

    设置密码,mysql密码要求大、小写、数字、特殊字符各一个且长度不能低于八位。

     1 Welcome to the MySQL monitor.  Commands end with ; or g.
     2 Your MySQL connection id is 4
     3 Server version: 5.7.18
     4 
     5 Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
     6 
     7 Oracle is a registered trademark of Oracle Corporation and/or its
     8 affiliates. Other names may be trademarks of their respective
     9 owners.
    10 
    11 Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
    12 
    13 mysql> alter user 'root'@'localhost' identified by 'yourpassword';
    14 Query OK, 0 rows affected (0.01 sec)

    参考资料:

    https://dev.mysql.com/doc/refman/5.7/en/linux-installation-yum-repo.html

    https://dev.mysql.com/doc/refman/5.7/en/validate-password-plugin.html

    作者: 采采灬卷耳

    <http://www.cnblogs.com/floay/>

    本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出, 原文链接 如有问题, 欢迎咨询。

  • 相关阅读:
    关于数据库的压测(window+liunx)
    参数化关联----三种方式
    jmeter的使用
    day07----------移动端测试
    day07----------Charles抓取web端的HTTPS协议下载和七个功能操作
    CURL 运用
    有关数据库的导出导入备份
    同时删除多张表的数据
    一条sql语句update 多条记录
    linux 将一个服务器上的文件或文件夹拷贝到另一个服务器上(转载)
  • 原文地址:https://www.cnblogs.com/floay/p/7085882.html
Copyright © 2020-2023  润新知