采用源碼安裝,可以根據(jù)實際生產(chǎn)環(huán)境加入一些參數(shù),提升mysql性能
mysql官網(wǎng)https://www.mysql.com/
本文采用5.1版本盡心安裝說明,后面版本如5.5安裝方法會有些不一樣,在公司的一些生產(chǎn)環(huán)境中也有用到
5.1版本mysql。
下載mysql源碼
解壓tar zxf mysql-5.1.72.tar.gz
cd mysql-5.1.72
配置
./configure --prefix=/usr/local/mysql \
--with-unix-socket-path=/usr/local/mysql/tmp/mysql.sock \
--localstatedir=/usr/local/mysql/data\
--enable-assemble \
--enable-thread-safe-client \
--with-mysqld-user=mysql \
--with-big-tables \
--with-pthread \
--with-extra-charsets=complex \
--with-readline \
--with-ssl \
--with-mysqld-ldflags=-all-static \
--with-client-ldflags=-all-static
[root@backupserver mysql-5.1.72]# ./configure --help 查看具體的配置參數(shù)
make&&make install
這里采用開發(fā)測試模板
/bin/cp support-files/my-small.cnf /etc/my.cnf
創(chuàng)建數(shù)據(jù)庫文件
mkdir -p /usr/local/mysql/data
chown -R mysql /usr/local/mysql授權(quán)mysql用戶可以訪問mysql目錄
/usr/local/mysql/bin/mysql_install_db --user=mysql安裝mysql數(shù)據(jù)庫文件
安裝完后會有一些相關(guān)說明,如如何啟動等等。
安裝安裝說明方法啟動mysql
/usr/local/mysql/bin/mysqld_safe/usr/local/mysql/bin/mysqld_safe & &表示后臺運行
為了更方便的啟動mysql,可以將mysql加到全局變量中
將mysql加到全局變量中echo 'export PATH=$PATH:/usr/local/mysql/bin'>>/etc/profile
source /etc/profile
執(zhí)行mysql進入數(shù)據(jù)庫
[root@backupserver mysql-5.1.72]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.72 Source distribution
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.
配置/etc/init.d/mysqld啟動mysql
cp support-files/mysql.server /etc/init.d/mysqld
chmod 700 /etc/init.d/mysqld 授權(quán),
將mysql服務(wù)加到開機啟動
[root@backupserver mysql-5.1.72]# chkconfig --add mysqld
[root@backupserver mysql-5.1.72]# chkconfig mysqld on
mysql進入數(shù)據(jù)庫
設(shè)置密碼set password for root@localhost=PASSWORD('123456');
后續(xù)采用mysql -uroot -p形式進入mysql數(shù)據(jù)庫
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機、免備案服務(wù)器”等云主機租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。
網(wǎng)站名稱:LinuxWEB服務(wù)器搭建-MySql篇-創(chuàng)新互聯(lián)
瀏覽路徑:http://aaarwkj.com/article0/dpecio.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站建設(shè)、關(guān)鍵詞優(yōu)化、網(wǎng)站設(shè)計公司、建站公司、小程序開發(fā)、定制網(wǎng)站
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容