CentOS 6.5是一款廣泛使用的Linux操作系統(tǒng),支持自定義安裝軟件包,使用戶能夠輕松編譯和安裝第三方應(yīng)用程序,例如MySQL數(shù)據(jù)庫。以下是CentOS 6.5編譯安裝MySQL數(shù)據(jù)庫的步驟。
步驟1:安裝依賴
yum install gcc gcc-c++ cmake ncurses-devel perl
步驟2:下載MySQL數(shù)據(jù)庫
wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.30.tar.gz
步驟3:解壓縮MySQL數(shù)據(jù)庫
tar -zxvf mysql-5.7.30.tar.gz
步驟4:創(chuàng)建MySQL數(shù)據(jù)庫安裝路徑
sudo mkdir /usr/local/mysql
步驟5:編譯MySQL數(shù)據(jù)庫
cd mysql-5.7.30 cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \ -DMYSQL_DATADIR=/usr/local/mysql/data \ -DDOWNLOAD_BOOST=1 \ -DWITH_BOOST=/usr/local/include/boost \ -DWITH_INNOBASE_STORAGE_ENGINE=1 \ -DWITH_MYISAM_STORAGE_ENGINE=1 \ -DENABLED_LOCAL_INFILE=1 \ -DDEFAULT_CHARSET=utf8 \ -DDEFAULT_COLLATION=utf8_general_ci \ -DWITH_READLINE=1 \ -DWITH_SSL=system make make install
步驟6:配置MySQL數(shù)據(jù)庫
sudo useradd mysql sudo chown -R mysql:mysql /usr/local/mysql cd /usr/local/mysql sudo ./bin/mysqld --initialize-insecure --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data sudo cp support-files/mysql.server /etc/init.d/mysql sudo chmod +x /etc/init.d/mysql sudo chkconfig --add mysql sudo chkconfig mysql on
步驟7:啟動MySQL數(shù)據(jù)庫
sudo service mysql start
完成!現(xiàn)在您已經(jīng)成功編譯安裝了MySQL數(shù)據(jù)庫。