setenv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export WS_HOME=$PWD | |
export PATH=${WS_HOME}/mysqlsrc/bin:$PATH | |
[ ! -e ${WS_HOME}/mysqlsrc/bin/mysql ] && echo "Can not find MySQL binaries, please create mysqlsrc link (${WS_HOME}/mysqlsrc) to MySQL binaries" && return 1; | |
version=`${WS_HOME}/mysqlsrc/bin/mysql --version | sed -n 's/.*\([0-9]\.[0-9]\.[0-9][0-9]\).*/\1/p' | cut -d'.' -f1,2` | |
echo "MySQL Version ($version)" | |
MY_FILE="${WS_HOME}/my.cnf" | |
[ -e $MY_FILE ] && return | |
echo "[mysqld_safe]" > $MY_FILE | |
echo "socket = $WS_HOME/mysql.sock" >> $MY_FILE | |
echo "loose-mysqlx_socket = $WS_HOME/mysqlx.sock" >> $MY_FILE | |
echo " " >> $MY_FILE | |
echo "[mysqld]" >> $MY_FILE | |
echo "basedir = $WS_HOME/mysqlsrc" >> $MY_FILE | |
echo "datadir = $WS_HOME/mysqldata" >> $MY_FILE | |
echo "port = 3306" >> $MY_FILE | |
echo "loose-mysqlx_port = 33060" >> $MY_FILE | |
echo "secure_file_priv = /tmp" >> $MY_FILE | |
[ $version="8.0" ] && echo "default_authentication_plugin = mysql_native_password" >> $MY_FILE | |
echo " " >> $MY_FILE | |
echo "log-bin = mysql-bin" >> $MY_FILE | |
echo "server-id = 1" >> $MY_FILE | |
echo "gtid_mode = ON" >> $MY_FILE | |
echo "enforce-gtid-consistency = ON" >> $MY_FILE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment