#!/usr/bin/env bash MySQL_ARM_Patch() { Get_ARM if [ "${Is_ARM}" = "y" ]; then patch -p1 < ${cur_dir}/src/patch/mysql-5.5-fix-arm-client_plugin.patch fi } MySQL_Gcc7_Patch() { if gcc -dumpversion|grep -Eq "^[7-9]|10"; then echo "gcc version: 7+" if [ "${DBSelect}" = "1" ] || echo "${mysql_version}" | grep -Eqi '^5.1.'; then patch -p1 < ${cur_dir}/src/patch/mysql-5.1-mysql-gcc7.patch elif [ "${DBSelect}" = "2" ] || echo "${mysql_version}" | grep -Eqi '^5.5.'; then patch -p1 < ${cur_dir}/src/patch/mysql-5.5-mysql-gcc7.patch fi fi } MySQL_Sec_Setting() { if [ -d "/proc/vz" ]; then ulimit -s unlimited fi if command -v systemctl >/dev/null 2>&1; then systemctl enable mysql.service fi /etc/init.d/mysql start ln -sf /usr/local/mysql/bin/mysql /usr/bin/mysql ln -sf /usr/local/mysql/bin/mysqldump /usr/bin/mysqldump ln -sf /usr/local/mysql/bin/myisamchk /usr/bin/myisamchk ln -sf /usr/local/mysql/bin/mysqld_safe /usr/bin/mysqld_safe ln -sf /usr/local/mysql/bin/mysqlcheck /usr/bin/mysqlcheck /etc/init.d/mysql restart sleep 2 /usr/local/mysql/bin/mysqladmin -u root password "${DB_Root_Password}" if [ $? -ne 0 ]; then echo "failed, try other way..." /etc/init.d/mysql restart cat >~/.emptymy.cnf< /etc/my.cnf< /etc/ld.so.conf.d/mysql.conf< /etc/my.cnf< /etc/ld.so.conf.d/mysql.conf< /etc/my.cnf< /etc/ld.so.conf.d/mysql.conf< /etc/my.cnf< /etc/ld.so.conf.d/mysql.conf< /etc/my.cnf< /etc/ld.so.conf.d/mysql.conf<