您好,登錄后才能下訂單哦!
多套后臺進程+線程+內存結構
多個端口,多個配置文件,多個日志文件,多個socket,多個server_id
多套數據
##PS:安裝多實例前,首先確保MySQL數據庫已安裝,mysql安裝參考:https://blog.51cto.com/zhuzhiwei/2140683
mkdir -p /data/330{7..9} #<=====創建多個目錄
================第一個實例===================
vim /data/3307/my.cnf
[mysqld]
basedir=/application/mysql
datadir=/data/3307/data
socket=/data/3307/mysql.sock
log-error=/data/3307/mysql.log
log-bin=/data/3307/mysql-bin
server-id=7
port=3307
[client]
socket=/data/3307/mysql.sock
================第二個實例===================
vim /data/3308/my.cnf
[mysqld]
basedir=/application/mysql
datadir=/data/3308/data
socket=/data/3308/mysql.sock
log-error=/data/3308/mysql.log
log-bin=/data/3308/mysql-bin
server-id=8
port=3308
[client]
socket=/data/3308/mysql.sock
================第三個實例===================
vim /data/3309/my.cnf
[mysqld]
basedir=/application/mysql
datadir=/data/3309/data
socket=/data/3309/mysql.sock
log-error=/data/3309/mysql.log
log-bin=/data/3309/mysql-bin
server-id=9
port=3309
[client]
socket=/data/3309/mysql.sock
=========================================
chown -R mysql.mysql /data/330* #<======將3個目錄授權給mysql用戶
/application/mysql/scripts/mysql_install_db --user=mysql --basedir=/application/mysql --datadir=/data/3307/data
=================================================================================
/application/mysql/scripts/mysql_install_db --user=mysql --basedir=/application/mysql --datadir=/data/3308/data
=================================================================================
/application/mysql/scripts/mysql_install_db --user=mysql --basedir=/application/mysql --datadir=/data/3309/data
=================================================================================
mysqld_safe --defaults-file=/data/3307/my.cnf &
====================================================================
mysqld_safe --defaults-file=/data/3308/my.cnf &
====================================================================
mysqld_safe --defaults-file=/data/3309/my.cnf &
====================================================================
touch /data/3309/mysql.log
touch /data/3308/mysql.log
touch /data/3307/mysql.log
chown -R mysql.mysql /data/330*
再次啟動多個實例即可。
===============進入實例===============================
mysql -s /data/3307/mysql.sock #首次進入無密碼
mysql -s /data/3308/mysql.sock
mysql -s /data/3309/mysql.sock
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。