您好,登錄后才能下訂單哦!
本文主要給大家簡(jiǎn)單講講怎么樣安裝多實(shí)例mysql數(shù)據(jù)庫(kù),相關(guān)專(zhuān)業(yè)術(shù)語(yǔ)大家可以上網(wǎng)查查或者找一些相關(guān)書(shū)籍補(bǔ)充一下,這里就不涉獵了,我們就直奔主題吧,希望怎么樣安裝多實(shí)例mysql數(shù)據(jù)庫(kù)這篇文章可以給大家?guī)?lái)一些實(shí)際幫助。
一、實(shí)驗(yàn)環(huán)境
系統(tǒng):cetos6.5
軟件:mysql-5.5.32.tar.gz
二、實(shí)驗(yàn)步驟
1.1 安裝cmake軟件
tar xf cmake-2.8.8.tar.gz
cd cmake-2.8.8
./configure
gmake
gmake install
1.2 創(chuàng)建用戶(hù)和組及其安裝mysql依賴(lài)包
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 配置環(huán)境變量寫(xiě)入/etc/profile文件中
PATH="/application/mysql/bin:$PATH"
1.5 創(chuàng)建多實(shí)例目錄啟動(dòng)腳本配置文件及其授權(quán)
/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 ---啟動(dòng)mysql進(jìn)程
/data/3307/mysql start ---啟動(dòng)mysql進(jìn)程
1.6 通過(guò)socket多實(shí)例方式登錄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 實(shí)現(xiàn)登錄成功
~]#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>
怎么樣安裝多實(shí)例mysql數(shù)據(jù)庫(kù)就先給大家講到這里,對(duì)于其它相關(guān)問(wèn)題大家想要了解的可以持續(xù)關(guān)注我們的行業(yè)資訊。我們的板塊內(nèi)容每天都會(huì)捕捉一些行業(yè)新聞及專(zhuān)業(yè)知識(shí)分享給大家的。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。