By separating the socket and port, each mysql can be started as a separate process.
# MySQL 8.0.23 with port 13306cd ~/tmp/path-to-your-dir
mkdir-p mysql/versions/8.0.23/datadir/mysql8-name1
cd mysql/versions/8.0.23
dir=`pwd`$dir/basedir/bin/mysqld \--initialize-insecure\--user=_dbdb_mysql \--port=13306 \--socket=/tmp/dbdb_mysql_13306.sock \--basedir=$dir/basedir \--plugin-dir=$dir/basedir/lib/plugin \--datadir=$dir/datadir/mysql8-name1 \--log-error=$dir/datadir/mysql8-name1/mysqld.err \--pid-file=$dir/datadir/mysql8-name1/mysql.pid
# MySQL 8.0.23 with port 23306cd ~/tmp/path-to-your-dir
mkdir-p mysql/versions/8.0.23/datadir/mysql8-name2
cd mysql/versions/8.0.23
dir=`pwd`$dir/basedir/bin/mysqld \--initialize-insecure\--user=_dbdb_mysql \--port=23306 \--socket=/tmp/dbdb_mysql_23306.sock \--basedir=$dir/basedir \--plugin-dir=$dir/basedir/lib/plugin \--datadir=$dir/datadir/mysql8-name2 \--log-error=$dir/datadir/mysql8-name2/mysqld.err \--pid-file=$dir/datadir/mysql8-name2/mysql.pid
# MySQL 5.7.31 with port 33306cd ~/tmp/path-to-your-dir
mkdir-p mysql/versions/5.7.31/datadir/mysql5-name3
cd mysql/versions/5.7.31
dir=`pwd`$dir/basedir/bin/mysqld \--initialize-insecure\--user=_dbdb_mysql \--port=33306 \--socket=/tmp/dbdb_mysql_33306.sock \--basedir=$dir/basedir \--plugin-dir=$dir/basedir/lib/plugin \--datadir=$dir/datadir/mysql5-name3 \--log-error=$dir/datadir/mysql5-name3/mysqld.err \--pid-file=$dir/datadir/mysql5-name3/mysql.pid
# MySQL 5.7.31 with port 43306cd ~/tmp/path-to-your-dir
mkdir-p mysql/versions/5.7.31/datadir/mysql5-name4
cd mysql/versions/5.7.31
dir=`pwd`$dir/basedir/bin/mysqld \--initialize-insecure\--user=_dbdb_mysql \--port=43306 \--socket=/tmp/dbdb_mysql_43306.sock \--basedir=$dir/basedir \--plugin-dir=$dir/basedir/lib/plugin \--datadir=$dir/datadir/mysql5-name4 \--log-error=$dir/datadir/mysql5-name4/mysqld.err \--pid-file=$dir/datadir/mysql5-name4/mysql.pid
Top comments (0)