• 用shell脚本安装MySQL-5.7.22-官方版本多实例


    Install_CentOS7_MySQL57_multi_instance.sh

    #
    !/bin/bash #请提前准备好参数文件my.cnf PORT=3307 InitMySQL() { mkdir -p /app/mysqldata/{$PORT/{data,tmp,binlog,redolog,undolog},backup,scripts} #################################################### chown -R mysql:mysql /app/mysqldata /usr/local/mysql/bin/mysqld --defaults-file=/app/mysqldata/$PORT/my.cnf --initialize --user=mysql /usr/local/mysql/bin/mysql_ssl_rsa_setup --defaults-file=/app/mysqldata/$PORT/my.cnf #################################################### echo "start mysqld" /usr/local/mysql/bin/mysqld_safe --defaults-file=/app/mysqldata/$PORT/my.cnf & sleep 5 echo "update root password" tmppasswd=`grep password /app/mysqldata/$PORT/error.log | awk '{print $NF}'` /usr/local/mysql/bin/mysql -uroot -p$tmppasswd -S /app/mysqldata/$PORT/mysql.sock --connect-expired-password -e "set password=password('msds007')" /usr/local/mysql/bin/mysql -uroot -pmsds007 -S /app/mysqldata/$PORT/mysql.sock -e "grant all on *.* to dba_user@'%' identified by 'msds007'" /usr/local/mysql/bin/mysql -uroot -pmsds007 -S /app/mysqldata/$PORT/mysql.sock -e "flush privileges" /usr/local/mysql/bin/mysql -uroot -pmsds007 -S /app/mysqldata/$PORT/mysql.sock -e "select user,host,authentication_string from mysql.user" } InitMySQL
  • 相关阅读:
    Git版本控制+配置中心(Spring Cloud Config)(八)
    NodeJS+Sidecar异构系统+Zuul(七)
    API网关Zuul(六)
    Hystrix断路器(五)
    Feign配合Ribbon和Eureka来提供负载均衡的HTTP客户端(四)
    负载均衡Ribbon(三)
    Eureka注册中心(二)
    SpringCloud介绍(一)
    Swift基础小结_2
    谓词(搜索)
  • 原文地址:https://www.cnblogs.com/allenhu320/p/11304800.html
Copyright © 2020-2023  润新知