這篇文章主要講解了“Liunx下mysql源碼安裝步驟”,文中的講解內(nèi)容簡(jiǎn)單清晰,易于學(xué)習(xí)與理解,下面請(qǐng)大家跟著小編的思路慢慢深入,一起來(lái)研究和學(xué)習(xí)“Liunx下mysql源碼安裝步驟”吧!
創(chuàng)新互聯(lián)主要從事成都網(wǎng)站設(shè)計(jì)、做網(wǎng)站、網(wǎng)頁(yè)設(shè)計(jì)、企業(yè)做網(wǎng)站、公司建網(wǎng)站等業(yè)務(wù)。立足成都服務(wù)麥積,10多年網(wǎng)站建設(shè)經(jīng)驗(yàn),價(jià)格優(yōu)惠、服務(wù)專(zhuān)業(yè),歡迎來(lái)電咨詢(xún)建站服務(wù):13518219792環(huán)境:
虛擬機(jī):CentOS-6.6-x86_64
mysql安裝包:mysql-5.6.34
在安裝源碼包之前,需要安裝一些rpm包
[root@potato ~]# rpm -qa|grep cmake
cmake-2.8.12.2-4.el6.x86_64
[root@potato ~]# rpm -qa|grep gcc
gcc-4.4.7-11.el6.x86_64
gcc-c++-4.4.7-11.el6.x86_64
[root@potato ~]# rpm -qa|grep make
make-3.81-20.el6.x86_64
[root@potato ~]# rpm -qa|grep make
[root@potato ~]# rpm -qa|grep libaio-devel
libaio-devel-0.3.107-10.el6.x86_64
創(chuàng)建用戶(hù)mysql
[root@potato ~]# useradd mysql
從官網(wǎng)下載mysql數(shù)據(jù)庫(kù)源碼包,地址:
http://dev.mysql.com/downloads/mysql/
將下載的tar包進(jìn)行解壓
[root@potato ~]# cd Desktop/
[root@potato Desktop]#tar -zxvf /tmp/soft
創(chuàng)建軟件存放目錄
[root@potato Desktop]#mkdir /opt/mysql/mysql-5.6
[root@potato Desktop]#cd /tmp/soft
[root@potato soft]# cd mysql-5.6.34/
[root@potato mysql-5.6.34]#mkdir temp
開(kāi)始編譯,并指定軟件存放目錄
[root@potato temp]#cmake -DBUILD_CONFIG=mysql_release -DCMAKE_INSTALL_PREFIX=/opt/mysql/mysql-5.6 ..
[root@potato temp]#make –j
[root@potato temp]#make install
自此mysql軟件安裝完成
在/usr/local目錄下配置mysql軟連接,并設(shè)置PATH變量
[root@potato unbx]# cd /usr/local/
[root@potato local]# ln -s /opt/mysql/mysql-5.6 mysql
[root@potato local]# echo "PATH=$PATH:/usr/local/mysql/bin">>/etc/profile
[root@potato local]# source /etc/profile
[root@potato mysql]# echo $PATH
/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/root/bin:/usr/local/mysql/bin
創(chuàng)建data目錄并賦權(quán)
[root@potato local]# mkdir -p /data/mysql/mytest_3306
[root@potato local]# chown -R mysql:mysql /data/mysql/mytest_3306
[root@potato local]# cd /usr/local/mysql
[root@potato mysql]# chown -R mysql:mysql *
創(chuàng)建配置文件my.cnf
[root@potato mysql]# cd /etc
[root@potato mysql]# vi /etc/my.cnf
注:可以在https://tools.percona.com,按步驟自動(dòng)生成my.cnf
初始化數(shù)據(jù)庫(kù),指定my.cnf文件
[root@potato mysql]# ./scripts/mysql_install_db --defaults-file=/etc/my.cnf --user=mysql
把mysql.server復(fù)制到/etc/init.d目錄下,并開(kāi)啟mysql服務(wù)
[root@potato mysql]# cp support-files/mysql.server /etc/init.d/mysql
[root@potato mysql]# /etc/init.d/mysql start
Starting MySQL... SUCCESS!
連接mysql
[root@potato mysql]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.34-log Source distribution
Copyright (c) 2000, 2016, 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.
root@localhost:mysql.sock 14:22:29 [(none)]>\s
--------------
mysql Ver 14.14 Distrib 5.6.34, for Linux (x86_64) using EditLine wrapper
Connection id: 1
Current database:
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 5.6.34-log Source distribution
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: utf8
Db characterset: utf8
Client characterset: utf8
Conn. characterset: utf8
UNIX socket: /tmp/mysql.sock
Uptime: 1 min 12 sec
Threads: 1 Questions: 6 Slow queries: 0 Opens: 70 Flush tables: 1 Open tables: 63 Queries per second avg: 0.083
--------------
感謝各位的閱讀,以上就是“Liunx下mysql源碼安裝步驟”的內(nèi)容了,經(jīng)過(guò)本文的學(xué)習(xí)后,相信大家對(duì)Liunx下mysql源碼安裝步驟這一問(wèn)題有了更深刻的體會(huì),具體使用情況還需要大家實(shí)踐驗(yàn)證。這里是創(chuàng)新互聯(lián),小編將為大家推送更多相關(guān)知識(shí)點(diǎn)的文章,歡迎關(guān)注!
文章標(biāo)題:Liunx下mysql源碼安裝步驟-創(chuàng)新互聯(lián)
瀏覽路徑:http://www.rwnh.cn/article4/dhheie.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站導(dǎo)航、移動(dòng)網(wǎng)站建設(shè)、品牌網(wǎng)站制作、標(biāo)簽優(yōu)化、電子商務(wù)、品牌網(wǎng)站設(shè)計(jì)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶(hù)投稿、用戶(hù)轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容
網(wǎng)頁(yè)設(shè)計(jì)公司知識(shí)