這篇文章主要講解了“怎么用二進(jìn)制包安裝mysql”,文中的講解內(nèi)容簡(jiǎn)單清晰,易于學(xué)習(xí)與理解,下面請(qǐng)大家跟著小編的思路慢慢深入,一起來研究和學(xué)習(xí)“怎么用二進(jìn)制包安裝mysql”吧!
10年積累的網(wǎng)站制作、做網(wǎng)站經(jīng)驗(yàn),可以快速應(yīng)對(duì)客戶對(duì)網(wǎng)站的新想法和需求。提供各種問題對(duì)應(yīng)的解決方案。讓選擇我們的客戶得到更好、更有力的網(wǎng)絡(luò)服務(wù)。我雖然不認(rèn)識(shí)你,你也不認(rèn)識(shí)我。但先網(wǎng)站制作后付款的網(wǎng)站建設(shè)流程,更有防城免費(fèi)網(wǎng)站建設(shè)讓你可以放心的選擇與我們合作。本文主要講述如何使用二進(jìn)制安裝mysql,并啟動(dòng)mysql
https://dev.mysql.com/downloads/mysql/
上傳mysql安裝包至/usr/local目錄
解壓mysql安裝包;
[root@localhost local]# tar xvf mysql-5.6.39-linux-glibc2.12-x86_64.tar.gz
將解壓后的文件夾連接至mysql文件夾
[root@localhost local]# ln -s mysql-5.6.39-linux-glibc2.12-x86_64 mysql
檢查并安裝依賴包(perl)
[root@localhost scripts]# yum -y install perl perl-devel perl-Data-Dumper
> 如若未安裝perl組件將會(huì)報(bào)以下錯(cuò)誤
[root@localhost scripts]# ./mysql_install_db
FATAL ERROR: please install the following Perl modules before executing ./mysql_install_db:
Data::Dumper
- 檢查并安裝依賴包(libaio)
[root@localhost mysql]# yum list|grep libaio
libaio.i686 0.3.109-13.el7 base
libaio.x86_64 0.3.109-13.el7 base
libaio-devel.i686 0.3.109-13.el7 base
libaio-devel.x86_64 0.3.109-13.el7 base
[root@localhost mysql]# yum -y install libaio libaio-devel
> 若如為安裝libaio組件將會(huì)報(bào)以下錯(cuò)誤
[root@localhost mysql]# scripts/mysql_install_db --user=mysql
WARNING: The host 'Alinx' could not be looked up with ./bin/resolveip.
This probably means that your libc libraries are not 100 % compatible
with this binary MySQL version. The MySQL daemon, mysqld, should work
normally with the exception that host name resolving will not work.
This means that you should use IP addresses instead of hostnames
when specifying MySQL privileges !
Installing MySQL system tables..../bin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory
[root@localhost mysql]#
### 3、創(chuàng)建mysql用戶,用戶組并將目錄授權(quán)給mysql用戶
[root@localhost scripts]# groupadd mysql
[root@localhost scripts]# useradd -r -g mysql mysql
[root@localhost ~]# chown mysql:mysql /usr/local/mysql -R
[root@localhost ~]# ll /usr/local/
total 321180
drwxr-xr-x. 2 root root 6 Aug 12 2015 bin
drwxr-xr-x. 2 root root 6 Aug 12 2015 etc
drwxr-xr-x. 2 root root 6 Aug 12 2015 games
drwxr-xr-x. 2 root root 6 Aug 12 2015 include
drwxr-xr-x. 2 root root 6 Aug 12 2015 lib
drwxr-xr-x. 2 root root 6 Aug 12 2015 lib64
drwxr-xr-x. 2 root root 6 Aug 12 2015 libexec
lrwxrwxrwx 1 mysql mysql 35 Jan 16 22:46 mysql -> mysql-5.6.39-linux-glibc2.12-x86_64
drwxr-xr-x 13 mysql mysql 4096 Jan 16 22:38 mysql-5.6.39-linux-glibc2.12-x86_64
-rw-r--r-- 1 root root 328882304 Jan 21 2018 mysql-5.6.39-linux-glibc2.12-x86_64.tar.gz
drwxr-xr-x. 2 root root 6 Aug 12 2015 sbin
drwxr-xr-x. 5 root root 46 Jan 17 2017 share
drwxr-xr-x. 2 root root 6 Aug 12 2015 src
> 此時(shí)可以看到mysql目錄的歸屬為mysql:mysql - 刪除系統(tǒng)中的mysql配置文件
rm -f /etc/my.cnf
rm -fr /etc/my.cnf.d/
### 4、初始化并啟動(dòng)mysql - 初始化
[root@localhost mysql]# scripts/mysql_install_db --user=mysql --datadir=/usr/local/mysql/data --skip-name-resolve
> 該步驟為創(chuàng)建了一個(gè)root用戶(空密碼),并初始化了mysql的一些權(quán)限賬戶表 - 拷貝配置文件以及啟動(dòng)腳本
[root@localhost mysql]# cp support-files/my-default.cnf /etc/my.cnf
[root@localhost mysql]# cp support-files/mysql.server /etc/init.d/mysqld
- 編輯/etc/my.cnf文件,并寫入如下內(nèi)容
basedir = /usr/local/mysql
datadir = /usr/local/mysql/data/
### 5、啟動(dòng)mysql - 啟動(dòng)mysql
/usr/local/mysql/support-files/mysqld start
- 為mysql數(shù)據(jù)庫設(shè)置密碼(跟進(jìn)提示進(jìn)行密碼設(shè)置,部署完時(shí)密碼為空)
[root@localhost mysql]# ./bin/mysql_secure_installation
- 登錄數(shù)據(jù)庫
[root@localhost mysql]# mysql -uroot -pAlinx
> 當(dāng)前啟動(dòng)時(shí)候報(bào)錯(cuò)(發(fā)現(xiàn)是/etc/my.cnf未配置目錄導(dǎo)致)
[root@localhost support-files]# /usr/local/mysql/support-files/mysql.server start
Starting MySQL.Logging to '/usr/local/mysql/data/localhost.err'.
ERROR! The server quit without updating PID file (/usr/local/mysql/data/localhost.pid).
[root@localhost support-files]#
感謝各位的閱讀,以上就是“怎么用二進(jìn)制包安裝mysql”的內(nèi)容了,經(jīng)過本文的學(xué)習(xí)后,相信大家對(duì)怎么用二進(jìn)制包安裝mysql這一問題有了更深刻的體會(huì),具體使用情況還需要大家實(shí)踐驗(yàn)證。這里是創(chuàng)新互聯(lián),小編將為大家推送更多相關(guān)知識(shí)點(diǎn)的文章,歡迎關(guān)注!
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。
網(wǎng)頁標(biāo)題:怎么用二進(jìn)制包安裝mysql-創(chuàng)新互聯(lián)
URL地址:http://aaarwkj.com/article36/dgdepg.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站收錄、網(wǎng)站設(shè)計(jì)、企業(yè)網(wǎng)站制作、虛擬主機(jī)、電子商務(wù)、建站公司
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(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í)需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容