CentOS體系下編譯裝置MySQL和設置相干yum源的教程。本站提示廣大學習愛好者:(CentOS體系下編譯裝置MySQL和設置相干yum源的教程)文章只能為提供參考,不一定能成為您想要的結果。以下是CentOS體系下編譯裝置MySQL和設置相干yum源的教程正文
編譯裝置軟件平日會碰到各類成績,特別是在編譯lamp如許的多種軟件協同任務時各軟件還互相影響,特別是之前裝置的軟件會影響後邊法式的編譯裝置,湧現這類成績經常是之前裝置的軟件沒有導出庫文件和頭文件,因此招致前面的軟件在裝置是須要指定後面裝置法式的途徑經常常提醒找不到文件之類的毛病,上面以mysql為例
1、裝置開辟情況
yum groupinstall "Development tools"
2、處理軟件包依附包
裝置編譯代碼須要的包
yum -y install make gcc-c++ cmake bison-devel ncurses-devel
下載MySQL 5.6.14
wget http://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.14.tar.gz tar xvf mysql-5.6.14.tar.gz cd mysql-5.6.14
3、設置裝備擺設編譯並裝置
cmake \ -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \ -DMYSQL_DATADIR=/usr/local/mysql/data \ -DSYSCONFDIR=/etc \ -DWITH_MYISAM_STORAGE_ENGINE=1 \ -DWITH_INNOBASE_STORAGE_ENGINE=1 \ -DWITH_MEMORY_STORAGE_ENGINE=1 \ -DWITH_READLINE=1 \ -DMYSQL_UNIX_ADDR=/var/lib/mysql/mysql.sock \ -DMYSQL_TCP_PORT=3306 \ -DENABLED_LOCAL_INFILE=1 \ -DWITH_PARTITION_STORAGE_ENGINE=1 \ -DEXTRA_CHARSETS=all \ -DDEFAULT_CHARSET=utf8 \ -DDEFAULT_COLLATION=utf8_general_ci make && make install
4、導出庫搜刮
在 /etc/ld.conf.d/mysql.conf 目次下創立響應的conf文件
ldconfig -v | grep mysql
5、導出頭文件
ln -sv /usr/local/mysql/include /usr/include/mysql
6、導出贊助文件
vim /etc/man.config MANPATH /usr/local/mysql/man
7、導出二進制途徑
vim /etc/profile PATH=/usr/local/mysql/bin:$PATH source /etc/profile
PS:若何應用MySQL yum源來裝置更新MySQL相干軟件包
MySQL yum庫供給了一個簡略的和便利的辦法來裝置和更新MySQL相干的軟件包到最新版本。
MySQL yum庫文檔解釋:http://dev.mysql.com/doc/mysql-yum-repo-quick-guide/en/
MySQL yum庫支撐的平台有:
Red Hat Enterprise Linux 7 / Oracle Linux 7
Red Hat Enterprise Linux 6 / Oracle Linux 6
Red Hat Enterprise Linux 5 / Oracle Linux 5
Fedora 18, 19, and 20
MySQL yum庫包含最新的軟件包有:
RHEL7/CentOS7/Oracle linux7:
# rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm # rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm
RHEL5/CentOS5/Oracle linux5:
# rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el5-5.noarch.rpm
Fedora
# Fedora20
# rpm -Uvh http://dev.mysql.com/get/mysql-community-release-fc20-5.noarch.rpm
#Fedora19
# rpm -Uvh http://dev.mysql.com/get/mysql-community-release-fc19-5.noarch.rpm
# Fedora18
# rpm -Uvh http://dev.mysql.com/get/mysql-community-release-fc18-5.noarch.rpm