zoukankan      html  css  js  c++  java
  • CentOS安装两个MYSQL5.7.21

    项目上正式是MySQL5.7.21-log版本,但是本地测试是使用的MySQL5.7.22,蛋疼的客户非得统一版本,本着学习的精神,自己折腾了一天、

    于是把测试数据库也撞上了MySQL5.7.21

    第一步 下载:mysql-5.7.21-linux-glibc2.12-x86_64

    第二步 上传、解压mysql-5.7.21-linux-glibc2.12-x86_64 ,使用tar -xvf mysql-5.7.21-linux-glibc2.12-x86_64,将解压的文件重命名并移到/usr/local

    第三步 在mysql-5.7下新增文件夹data,var,etc备用

    第四步 创建数据库配置文件,如果在/etc(不是自己创建的)下有my.cnf则修改,如果没有则touch新建

    # For advice on how to change settings please see
    # http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html
    # *** DO NOT EDIT THIS FILE. It‘s a template which will be copied to the
    # *** default location during install, and will be replaced if you
    # *** upgrade to a newer version of MySQL.
    
    [mysqld]
    
    # Remove leading # and set to the amount of RAM for the most important data
    # cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
    # innodb_buffer_pool_size = 128M
    
    # Remove leading # to turn on a very important data integrity option: logging
    # changes to the binary log between backups.
    # log_bin
    
    # These are commonly set, remove the # and set as required.
    # /usr/local/mysql5721/mysql-5.7.21是解压之后的文件夹 basedir=/usr/local/mysql5721/mysql-5.7.21 datadir =/usr/local/mysql5721/mysql-5.7.21/data port = 5723 log-error = /usr/local/mysql5721/mysql-5.7.21/data/error.log pid-file = /usr/local/mysql5721/mysql-5.7.21/data/mysql.pid socket = /usr/local/mysql5721/mysql-5.7.21/mysql.sock # Remove leading # to set options mainly useful for reporting servers. # The server defaults are faster for transactions and fast SELECTs. # Adjust sizes as needed, experiment to find the optimal values. # join_buffer_size = 128M # sort_buffer_size = 2M # read_rnd_buffer_size = 2M #sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES [client] socket = /usr/local/mysql5721/mysql-5.7.21/mysql.sock

      第五步改变文件夹权限,使得mysql可以访问

    #groupadd mysql2
    #useradd mysql2-g mysql2
    #chown -R mysql2:mysql2 mysql-5.7.21/
    #chmod -R 777 mysql-5.7.21/
    

      第六步

      指定配置文件初始化

     ./bin/mysqld --defaults-file=/usr/local/mysql5721/mysql-5.7.21/etc/my.cnf --initialize --user=mysql2 --socket = /tmp/mysql5721.socket --port=5721
    

      查询默认密码

      

    cat /usr/local/mysql5721/mysql5.7.21/data/error.log
    

      generated for root@localhost后面就是默认生成的密码

    第七步

      启动mysql,执行 ./support-files/mysql.server start

    第八步

      修改密码配置权限,打开Navicat连接

    问题以及参考文章

    MYSQL多数据库安装

    https://blog.csdn.net/u010898329/article/details/83064373

    MYSQL安装后一些问题

    解决Navicat 报错:1130-host is not allowed MySQL不允许从远程访问的方法

    https://www.cnblogs.com/mengyuxin/p/5485143.html

    You must reset your password using ALTER USER statement before executing this statement.

    https://www.cnblogs.com/debmzhang/p/5013540.html

    MySQL添加用户、删除用户与授权

     https://www.cnblogs.com/wanghetao/p/3806888.html

    送给自己一句话

      

    我愿意给你当狗,你不要,你怕我咬你,结果我成了龙了

                              ——郭德纲

                              

  • 相关阅读:
    JVM详解(十)——垃圾回收算法
    JVM详解(九)——StringTable
    JVM详解(八)——执行引擎
    JVM详解(七)——直接内存
    JVM详解(六)——对象的实例化、内存布局与访问定位
    JVM详解(五)——运行时数据区-方法区
    JVM详解(四)——运行时数据区-堆
    http发送url请求
    超简单超详细的redis安装教程
    org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter 'bookID' not found. Available parameters are [param1, bookId]解决问题
  • 原文地址:https://www.cnblogs.com/leowenleung/p/10279489.html
Copyright © 2011-2022 走看看