您好,登錄后才能下訂單哦!
本文主要給大家簡單講講怎么樣安裝多實例mysql數據庫,相關專業術語大家可以上網查查或者找一些相關書籍補充一下,這里就不涉獵了,我們就直奔主題吧,希望怎么樣安裝多實例mysql數據庫這篇文章可以給大家帶來一些實際幫助。
一、實驗環境
系統:cetos6.5
軟件:mysql-5.5.32.tar.gz
二、實驗步驟
1.1 安裝cmake軟件
tar xf cmake-2.8.8.tar.gz
cd cmake-2.8.8
./configure
gmake
gmake install
1.2 創建用戶和組及其安裝mysql依賴包
groupadd mysql
useradd mysql -s /sbin/nologin -M msyql
yum -y install ncurses-devel
1.3 解壓編譯安裝mysql
tar xf mysql-5.5.32.tar.gz
cd mysql-5.5.32.tar.gz
cmake . -DCMAKE_INSTALL_PREFIX=/application/mysql-5.5.32 \
-DMYSQL_DATADIR=/application/mysql-5.5.32/data \
-DMYSQL_UNIX_ADDR=/application/mysql-5.5.32/tmp/mysql.sock \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DEXTRA_CHARSETS=gbk,gb2312,utf8,ascii \
-DENABLED_LOCAL_INFILE=ON \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_FEDERATED_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 \
-DWITHOUT_PARTITION_STORAGE_ENGINE=1 \
-DWITH_FAST_MUTEXES=1 \
-DWITH_ZLIB=bundled \
-DENABLED_LOCAL_INFILE=1 \
-DWITH_READLINE=1 \
-DWITH_EMBEDDED_SERVER=1 \
-DWITH_DEBUG=0
make && make install
1.4 配置環境變量寫入/etc/profile文件中
PATH="/application/mysql/bin:$PATH"
1.5 創建多實例目錄啟動腳本配置文件及其授權
/data/
├── 3306
│ ├── data
│ ├── my.cnf
│ └── mysql
└── 3307
├── data
├── my.cnf
└── mysql
chown -R mysql.mysql /data/
find /data/ -type f -name "mysql"|xargs chmod +x
/data/3306/mysql start ---啟動mysql進程
/data/3307/mysql start ---啟動mysql進程
1.6 通過socket多實例方式登錄mysql
mysql -S /data/3306/mysql.sock
mysql -S /data/3307/mysql.sock
1.7 修改密碼
mysqladmin -uroot -S /data/3306/mysql.sock password '123'
mysqladmin -uroot -S /data/3307/mysql.sock password '123'
1.8 改密碼后的登錄方式
mysql -uroot -p -S /data/3306/mysql.sock
mysql -uroot -p -S /data/3307/mysql.sock
1.9 實現登錄成功
~]#mysql -uroot -p -S /data/3306/mysql.sock
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.5.32 Source distributio
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
~]#mysql -uroot -p -S /data/3307/mysql.sock
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.5.32 Source distributio
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement
mysql>
怎么樣安裝多實例mysql數據庫就先給大家講到這里,對于其它相關問題大家想要了解的可以持續關注我們的行業資訊。我們的板塊內容每天都會捕捉一些行業新聞及專業知識分享給大家的。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。