須要用到的資源包php
wget https://downloads.mariadb.com/MariaDB/mariadb-10.2.6/bintar-linux-glibc_214-x86_64/mariadb-10.2.6-linux-glibc_214-x86_64.tar.gz
tar xzvf mariadb-10.2.6-linux-glibc_214-x86_64.tar.gz
mv mariadb-10.2.6-linux-glibc_214-x86_64 /usr/local/mariadb
mkdir /data/
useradd mysql
6.安裝配置信息mysql
./scripts/mysql_install_db --user=mysql datadir=/data/mariadb basedir=/usr/local/mariadb
一樣使用 echo $? 判斷執行是否成功linux
7.拷貝配置文件sql
support-files/下面有不少選擇,如my-large.cnf、my-medium.cnf ,區別呢就是針對內存大小默認有不一樣的緩存大小設置apache
cp support-files/my-small.cnf /usr/local/mariadb/my.cnf
cp support-file/mysql.server /etc/init.d/mariadb
9.配置文件/usr/local/mariadb/my.cnf參數解釋緩存
server-id用來作主從的參數socket
添加上datadir=/data/mariadb/basedir=/usr/local/mariadb(此配置必須添加,由於安裝時指定basedir的地址,啓動時會尋找此配置,不然會報錯,以下圖所示:)函數
mysqld參數及服務端,修改便可測試
socket參數能夠從新定義ui
修改basedir、datadir
添加自定義參數 conf=$basedir/my.cnf
/etc/init.d/mariadb start
ps aux | grep mysqld
netstat -lntp
wget http://mirrors.cnnic.cn/apache/httpd/httpd-2.4.34.tar.gz wget http://mirrors.cnnic.cn/apache/apr/apr-1.6.3.tar.gz wget http://mirrors.cnnic.cn/apache/apr/apr-util-1.6.1.tar.gz
tar zxvf httpd-2.4.34.tar.gz tar zxvf apr-1.6.3.tar.gz tar zxvf apr-util-1.6.1.tar.gz
cd /usr/local/src/apr-1.6.3
./configure --prefix=/usr/local/apr
[root@yolks2 apr-1.6.3]# ./configure --prefix=/usr/local/apr checking build system type... x86_64-pc-linux-gnu checking host system type... x86_64-pc-linux-gnu checking target system type... x86_64-pc-linux-gnu Configuring APR library Platform: x86_64-pc-linux-gnu checking for working mkdir -p... yes APR Version: 1.6.3 checking for chosen layout... apr checking for gcc... no checking for cc... no checking for cl.exe... no configure: error: in `/usr/local/src/apr-1.6.3': configure: error: no acceptable C compiler found in $PATH See `config.log' for more details
解決辦法:安裝GCC軟件套件
yum install gcc
make && make install
緣由是缺乏expat的開發庫,手動安裝便可
yum install -y expat-devel
echo $?
cd apr-util-1.6.1
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
make && make install
echo $?
-- enable-so :支持模塊 -- enable-mods-shared=most : 支持模塊most大多數 ./configure --prefix=/usr/local/apache2.4 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --enable-so --enable-mods-shared=most
解決辦法:經過yum 安裝便可
yum install -y pcre-devel
make && make install
在configure後加上 「--with-included-apr」。再從新編譯, make, make install. 便可。
問題又來了,加上--with-included-apr以後,編譯,報錯以下:
configure: error: Bundled APR requested but not found at ./srclib/. Download and unpack the corresponding apr and apr-util packages to ./srclib/.
錯誤爲:apr,apr-util缺失,須要下載並解壓到./srclib/目錄下
解決辦法:
# cd /usr/local/src/ # cp -r apr-1.6.3 /usr/local/src/httpd-2.4.34/srclib/apr # cp -r apr-util-1.6.1 /usr/local/src/httpd-2.4.34/srclib/apr-util
echo $?
1. /usr/local/apache2.4/bin/httpd -M 2. /usr/local/apache2.4/bin/apachectl -M
/usr/local/apache2.4/bin/apachectl start
ps aux | grep httpd
netstat -lntp
php中mysql,mysqli,mysqlnd,pdo究竟是什麼 http://blog.csdn.net/u013785951/article/details/60876816
查看編譯參數 http://ask.apelearn.com/question/1295