标签:profile cmake dde class mysql admin span black chkconfig
1 #!/bin/bash 2 #date:2019/1/17 3 #by zhangjia 4 #sheel_name:mysql_auto_install.sh 5 #auot install mysql 6 7 set -e 8 yum install -y vim gcc wget cmake ncurses-devel ncurses gcc-c++ 9 useradd -M -s /sbin/nologin mysql || true 10 mysql_version=mysql-5.6.36 11 install_dir=/usr/local/mysql56 12 data_dir=/data/mysql 13 mysql_password=123456 14 \cp mysql-5.6.36.tar.gz /usr/src 15 cd /usr/src 16 [[ -d ${data_dir} ]] && /bin/mv ${data_dir} ${data_dir}_`date +%s` 17 mkdir -p ${data_dir} && chown -R mysql:mysql ${data_dir} 18 #[[ -e /usr/src/${mysql_ver}.tar.gz ]] || wget -c http://mirrors.sohu.com/mysql/MySQL-5.6/${mysql_ver}.tar.gz 19 [[ -d ${base_dir} ]] && rm -rf ${base_dir} 20 tar -xzf ${mysql_version}.tar.gz 21 cd ${mysql_version} 22 cmake . -DCMAKE_INSTALL_PREFIX=${install_dir} 23 -DMYSQL_UNIX_ADDR=/tmp/mysql.sock 24 -DMYSQL_DATADIR=${data_dir} 25 -DSYSCONFDIR=/etc 26 -DMYSQL_USER=mysql 27 -DMYSQL_TCP_PORT=3306 28 -DWITH_XTRADB_STORAGE_ENGINE=1 29 -DWITH_INNOBASE_STORAGE_ENGINE=1 30 -DWITH_PARTITION_STORAGE_ENGINE=1 31 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 32 -DWITH_MYISAM_STORAGE_ENGINE=1 33 -DWITH_READLINE=1 34 -DENABLED_LOCAL_INFILE=1 35 -DWITH_EXTRA_CHARSETS=1 36 -DDEFAULT_CHARSET=utf8 37 -DDEFAULT_COLLATION=utf8_general_ci 38 -DEXTRA_CHARSETS=all 39 -DWITH_BIG_TABLES=1 40 -DWITH_DEBUG=0 41 make -j4 42 make -j4 install 43 cd ${install_dir} 44 \cp support-files/my-large.cnf /etc/my.cnf 45 \cp support-files/mysql.server /etc/init.d/mysqld 46 chkconfig --add mysqld 47 chkconfig --level 345 mysqld on 48 ${install_dir}/scripts/mysql_install_db --user=mysql --datadir=${data_dir} --basedir=${install_dir} 49 echo "export PATH=${install_dir}/bin:\$PATH" >> /etc/profile 50 source /etc/profile 51 service mysqld start 52 mysqladmin -u root password ${mysql_password} 53 netstat -natp|grep msyqld 54 ps aux|grep mysql
标签:profile cmake dde class mysql admin span black chkconfig
原文地址:https://www.cnblogs.com/zhj5551/p/11198346.html