• centos6 yum安装最新版mysql5.7


    在看来mysql5.7诸多改进介绍后,决定也安装一个试用下;本文将使用rpm的方式来安装。

    环境:
    OS: CentOS6.5 x86_64 最小化安装
    MEM: 1G
    CPU: 1

    1. 本文连着上一篇安装GCC5.3之后,新版本的glibc环境需设置到全局环境

    shell> strings /usr/lib64/libstdc++.so.6|grep GLIBCXX # 查看当前版本
    shell> rm -f /usr/lib64/libstdc++.so.6
    shell> ln -s /usr/local/lib64/libstdc++.so.6.0.21 /usr/lib64/libstdc++.so.6
    shell> strings /usr/local/lib64/libstdc++.so.6.0|grep GLIBCXX # 查看当前版本

    2. 更新yum源到最新

    shell> yum update
    # 下载mysql的yum仓库文件
    shell> wget
    # 安装mysql yum repo
    shell> rpm -Uvh mysql57-community-release-el6-7.noarch.rpm
    # 或: yum localinstall mysql57-community-release-el6-7.noarch.rpm
    # 查看
    shell> vim /etc/yum.repos.d/mysql-community.repo # 可以看到里面关于mysql的内容,确保mysql57的enable是打开的状态(1)

    3. 安装mysql服务

    shell> yum install mysql-community-server

    # 完成后启动服务
    shell> service mysqld start

    # 启动后,查看安装后自动生成的密码
    shell> grep "password" /var/log/mysqld.log
    ## 输出
    2015-12-24T02:12:21.721431Z 1 [Note] A temporary password is generated for root@localhost: s8)9B9)!#iWJ
    2015-12-24T02:12:25.495271Z 0 [Note] Execution of init_file '/var/lib/mysql/install-validate-password-plugin.lv0PNr.sql' started.
    2015-12-24T02:12:25.506256Z 0 [Note] Execution of init_file '/var/lib/mysql/install-validate-password-plugin.lv0PNr.sql' ended.
    2015-12-24T02:12:27.323654Z 0 [Note] Shutting down plugin 'sha256_password'
    2015-12-24T02:12:27.323657Z 0 [Note] Shutting down plugin 'mysql_native_password'
    2015-12-24T02:12:29.351753Z 2 [Note] Access denied for user 'UNKNOWN_MYSQL_USER'@'localhost' (using password: NO)

    ## 第一行“root@localhost:”后面的字符就是密码了,我们需要用它来设置我们自己的root登录密码
    shell> mysql_secure_installation
    ## 输出
    Securing the MySQL server deployment.

    Enter password for user root: [请在这里输出自动生成的密码,如:s8)9B9)!#iWJ]
    ## 注:密码必须满足1)长度大于8;2)包含至少1个数字,1个大写字母,1个小写字母,1个非字母数字的符号;3)长度不得超过32位。
    ## 完成后还需要设置一些初始化的配置,请按照提示来做

    # 以上步骤结束后,可以使用root用户登录mysql试试了
    shell> mysql -u root -p

    # mysql的配置文件所在目录
    shell> find / -name my.cnf
    ## 输出
    /etc/my.cnf

    4. 更多配置请到my.cnf中修改

    5. 其他

    官方文档请查看:

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

  • 相关阅读:
    牛客多校第一场 A Equivalent Prefixes 单调栈(笛卡尔树)
    HDU多校第三场 Hdu6606 Distribution of books 线段树优化DP
    (待写)
    Hdu6586 String 字符串字典序贪心
    2019HDU多校第一场1001 BLANK (DP)(HDU6578)
    iOS触摸事件
    iOS获取相册/相机图片-------自定义获取图片小控件
    自定义表情输入框
    iOS版本、iPhone版本、Xcode版本比对
    Swift备忘录
  • 原文地址:https://www.cnblogs.com/zqifa/p/linux-mysql-1.html
Copyright © 2020-2023  润新知