zoukankan      html  css  js  c++  java
  • linux下安装mysql-5.7.25

    1、下载对应安装包 https://dev.mysql.com/downloads/mysql/

    2、卸载旧版本mysql

    列出旧版本MySql的组件列表  rpm -qa | grep mysql

    移除相关组件 rpm -e --nodeps {-file-name}

    3、解压tar -zxvf mysql-5.7.25-1.el7.x86_64.rpm-bundle.tar 报错

    gzip: stdin: not in gzip format
    3 tar: Child returned status 1
    4 tar: Error is not recoverable: exiting now

    压缩包没有用gzip格式压缩,所以不用加z参数 命令改为 tar -xvf mysql-5.7.25-1.el7.x86_64.rpm-bundle.tar

     4、按照依赖关系依次安装rpm包 依赖关系依次为common→libs→client→server

    # rpm -ivh mysql-community-common-5.7.25-1.el7.x86_64.rpm

    # rpm -ivh mysql-community-libs-5.7.25-1.el7.x86_64.rpm

    # rpm -ivh mysql-community-client-5.7.25-1.el7.x86_64.rpm

    # rpm -ivh mysql-community-server-5.7.25-1.el7.x86_64.rpm

    *在安装 mysql-community-libs-5.7.25-1.el7.x86_64.rpm 时有可能会报错:mysql依赖错误

    warning: mysql-community-libs-5.7.25-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
    error: Failed dependencies:
            mysql-community-common(x86-64) >= 5.7.9 is needed by mysql-community-libs-5.7.25-1.el7.x86_64
            mariadb-libs is obsoleted by mysql-community-libs-5.7.25-1.el7.x86_64

    解决:清除yum里所有mysql依赖包

    # rpm -qa|grep mysql

    # yum remove mysql-libs

    5、启动mysql

    # systemctl start mysqld

    6、登录mysql

    获得安装时默认密码

    # cat /var/log/mysqld.log | grep "temporary password"

    # mysql -uroot -p

    **登录成功操作会报错需要修改密码

    mysql > set password for root@localhost=password('你的密码);

    授权远程访问

    mysql >  GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'youpassword' WITH GRANT OPTION;

    执行某段sql脚本报错

    [Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated c

    解决

    my.cnf 里面设置
    sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'
    在sql_mode 中去掉only_full_group_by 

  • 相关阅读:
    nslookup查询结果详解
    【Web页面测试】测试点和测试用例
    【CloverETL培训】题目
    VirtualBox虚拟机网络设置(四种方式)
    Web系统测试Web安全性测试
    sqlserver字段类型详解
    详解SVN 的使用
    Javascript闭包——懂不懂由你,反正我是懂了
    Javascript的console.log()用法
    [ JS 进阶 ] test, exec, match, replace
  • 原文地址:https://www.cnblogs.com/guxiong/p/10658925.html
Copyright © 2011-2022 走看看