MySQL 5.6.27 script automation installation

Source: Internet
Author: User

#!/bin/bash#-------------------install mysql 5.6.27 :: begin------------------------MySQL  -v &>/dev/nullif [ $? -eq 0 ];then    mysql  -V    echo  "Mysql is exist"  else    cd  /app/service/tools    tar -zxvf mysql-5.6.27.tar.gz    cd  mysql-5.6.27    cmake     -dcmake_install_prefix=/usr/local /mysql     -dmysql_datadir=/usr/local/mysql/data     - dsysconfdir=/etc     -dwith_myisam_storage_engine=1     - dwith_innobase_storage_engine=1     -dwith_memory_storage_engine=1      -DWITH_READLINE=1     -DMYSQL_UNIX_ADDR=/var/lib/mysql/mysql.sock      -dmysqL_tcp_port=3306     -denabled_local_infile=1     -dwith_ partition_storage_engine=1     -dextra_charsets=all     - ddefault_charset=utf8     -ddefault_collation=utf8_general_ci     make && make install     #创建用户和用户组     groupadd  mysql && useradd -g mysql mysql && echo  "Useradd  mysql finish "     #创建目录并分配权限     mkdir /usr/local/ Mysql &>/dev/null    chown -r mysql:mysql /usr/local/mysql      #进入安装目录执行脚本, start service     cd /usr/local/mysql     scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data -- user=mysql    Cp support-files/mysql.server /etc/init.d/mysql    rm -rf /etc/my.cnf     chkconfig mysql on    service mysql start      #设置PATH, call Mysql    ln -s /usr/local/mysql/bin/mysql directly  /usr/bin/fi

This article from "Xiaobao" blog, declined reprint!

MySQL 5.6.27 script automation installation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.