• 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 

  • 相关阅读:
    滑动加载
    关于git的常用命令
    github相关指令学习
    jquery的contains方法
    vertical-align_CSS参考手册_web前端开发参考手册系列
    关于拜读张鑫旭文章,了解的新属性
    如何从GitHub仓库clone项目
    关于小窗滑动,父级body也跟随滑动的解决方案(2)
    vue父子组件传递参数之props
    JsExcelXml.js的源码
  • 原文地址:https://www.cnblogs.com/guxiong/p/10658925.html
Copyright © 2020-2023  润新知