安裝及設定 ProxySQL

安裝及設定 ProxySQL

為了要在 MySQL 上實現讀寫分離,所以採用 ProxySQL 來達成目標。
 
更新 Repository 
apt-get install -y --no-install-recommends lsb-release wget apt-transport-https ca-certificates gnupg
wget -O - 'https://repo.proxysql.com/ProxySQL/proxysql-2.6.x/repo_pub_key' | apt-key add - 
echo deb https://repo.proxysql.com/ProxySQL/proxysql-2.6.x/$(lsb_release -sc)/ ./ | tee /etc/apt/sources.list.d/proxysql.list
更新並安裝 ProxySQL
sudo apt-get update
sudo apt-get install proxysql
啟動服務
systemctl enable proxysql
systemctl restart proxysql