linux lnmp搭建及解釋
lnmp的搭建
linux nginx mysql(mariaDB) php
安裝mysql依賴:
yum -y install cmake(cmake編譯工具)
yum -y install gcc gcc-c++
yum -y install ncurses-devel
安裝mysql
[[email protected]]# useradd mysql
[[email protected]]# tar -xf mysql-5.6.26.tar.gz
[[email protected]]# cd mysql
[[email protected]
[[email protected] mysql]# make
[[email protected] mysql]# make install
[[email protected] mysql]# chown -R mysql.mysql /usr/local/mysql/(設置權限,所有者,所屬主)
初始化數據庫
[[email protected] mysql]# ./scripts/mysql_install_db --user=mysql --datadir=/usr/local/mysql/data(到scripts目錄下運行腳本)
[[email protected]
auto.cnf ib_logfile0 mysql test web2.pid
。。。。。。。。
[[email protected] ~]# vim /etc/ld.so.conf(到搜索路徑加上mysql的庫)
/usr/local/mysql/lib/
[[email protected] ~]# ldconfig
[[email protected] mysql]# mv support-files/mysql.server /etc/init.d/mysqld(把啟動腳本放到etc/init.d)
[[email protected]