MySQL installation script

Source: Internet
Author: User
Tags openssl

#!/bin/shif [ -s /etc/my.cnf ];thenrm -rf /etc/my.cnffiecho  "-------------- --------------------start install mysql -----------------------------"yum install -y  ncurses gcc gcc-c++ ncurses ncurses-devel openssl openssl-devel  libtool* cmakemkdir -p /data/mysqlif [  ' grep  "MySQL"  /etc/passwd |  wc -l '  ]; thenecho  "Adding user mysql" groupadd mysqluseradd -s  /sbin/nologin -M -g mysql mysqlelseecho  "Mysql user exists" Fiecho   "-------------------------------downloading mysql----------------------------------" wget http ://dev.mysql.com/get/downloads/mysql-5.5/mysql-5.5.46.tar.gz echo  "------------------------------ unpackaging mysql -----------------------------------"TAR -XVF MYSQL-5.5.46.TAR.GZ CD  mysql-5.5.46 echo&nBSP; " -------------------------configuring mysql,please wait-----------------"Cmake -dcmake_install_ Prefix=/usr/local/mysql \-dmysql_unix_addr=/tmp/mysql.sock \-ddefault_charset=utf8 \-ddefault_ Collation=utf8_general_ci \-dwith_extra_charsets:string=utf8,gbk \-dwith_myisam_storage_engine=1  \-dwith_innobase_storage_engine=1 \-dwith_memory_storage_engine=1 \-dwith_readline=1 \- denabled_local_infile=1 \-dmysql_datadir=/var/mysql/data \-dmysql_user=mysqlif [ $? - ne 0 ];thenecho  "configure failed ,please check it out!" exit 1fiecho  "Make mysql, please wait for 20 minutes" makeif [  $? -ne 0 ];thenecho  "make failed ,please check it out!" exit 1fimake installchown -r mysql:mysql /usr/local/mysqlchown -r  Mysql.mysql /data/mysql//usr/local/mysqL/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/data/mysql#chown  -r mysql /usr/local/mysql/varchgrp -r mysql /usr/local/mysql/cp -f ./ support-files/my-large.cnf /etc/my.cnf sed -i  ' s#^thread_concurrency = 8#&  \ndatadir = /data/mysql#g '  /ETC/MY.CNFCP ./SUPPORT-FILES/MYSQL.SERVER /ETC/RC.D /init.d/mysqlchmod 755 /etc/init.d/mysql#chkconfig --add mysqld#chkconfig --level  2345 mysqld onln -s /usr/local/mysql/lib/mysql /usr/lib/mysqlln -s / usr/local/mysql/include/mysql /usr/include/mysqlln -s /usr/local/mysql/bin/mysql /usr/bin/ mysqlln -s /usr/local/mysql/bin/mysqldump /usr/bin/mysqldumpln -s /usr/local/mysql/ Bin/myisamchk /usr/bin/myisamchkln -s /usr/local/mysql/bin/mysqld_safe /usr/bin/mysqld_ safeecho  "Mysql&nbSp;starting "/usr/local/mysql/bin/mysqld --user=mysqlif [ $? -ne 0 ];thenecho   "mysql start filed ,please check it out!" elseecho  "Mysql start successful,congratulations!" Fi


MySQL installation script

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.