로컬 Mac에서 여러 MySQL 데이터베이스 서버 생성
설명
다운로드
MySQL 설치
# 8.0.23
mkdir -p ~/tmp/path-to-your-dir
cd ~/tmp/path-to-your-dir
mkdir -p mysql/versions/8.0.23/basedir
cd mysql/versions/8.0.23/basedir
wget https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.23-macos10.15-x86_64.tar.gz
tar zxf mysql-8.0.23-macos10.15-x86_64.tar.gz --strip-components 1
# 5.7.31
mkdir -p ~/tmp/path-to-your-dir
cd ~/tmp/path-to-your-dir
mkdir -p mysql/versions/5.7.31/basedir
cd mysql/versions/5.7.31/basedir
wget https://downloads.mysql.com/archives/get/p/23/file/mysql-5.7.31-macos10.14-x86_64.tar.gz
tar zxf mysql-5.7.31-macos10.14-x86_64.tar.gz --strip-components 1
사용자 정의 datadir 및 포트로 MySQL 서버 초기화
# MySQL 8.0.23 with port 13306
cd ~/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 23306
cd ~/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 33306
cd ~/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 43306
cd ~/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
무엇 향후 계획?
Reference
이 문제에 관하여(로컬 Mac에서 여러 MySQL 데이터베이스 서버 생성), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://dev.to/yuki777/create-multiple-mysql-database-server-on-local-mac-4k2m텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)