标签:fda
#!/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 mysql useradd -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 "-------------------------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 starting"/usr/local/mysql/bin/mysqld --user=mysqlif [ $? -ne 0 ];thenecho "mysql start filed ,please check it out!"elseecho "mysql start successful,congratulations!"fi
标签:fda
原文地址:http://8934920.blog.51cto.com/8924920/1883432