lnp和mysql分开安装_毕业设计之LNP+DISCUZ +分离的数据库操作
環境介紹:
CentOS6.9最小化安裝
https://nginx.org/download/nginx-1.16.1.tar.gz
https://www.php.net/distributions/php-7.3.14.tar.gz
https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-boost-5.7.29.tar.gz
nginx+php主機:192.168.111.141
mysql主機:192.168.111.151
nginx install?192.168.111.141
yum install -y gcc gcc-c++ autoconf automake zlib zlib-devel openssl openssl-devel pcre* make gd-devel libjpeg-devel
libpng-devel libxml2-devel bzip2-devel libcurl-devel wget unzip
[root@webtwo.quan.bbs~]$cd /data/packages/[root@webtwo.quan.bbs packages]$wget https://nginx.org/download/nginx-1.16.1.tar.gz
[root@webtwo.quan.bbs packages]$tar -xvzf nginx-1.16.1.tar.gz
[root@webtwo.quan.bbs packages]$cd nginx-1.16.1[root@webtwo.quan.bbs nginx-1.16.1]$./configure --prefix=/usr/local/software/nginx1.16.1\> --user=nginx \> --group=nginx \> --with-http_ssl_module \> --with-http_v2_module \> --with-http_stub_status_module \> --with-pcre
[root@webtwo.quan.bbs nginx-1.16.1]$make &&make install
建立軟連接,便于命令和軟件的升級
[root@webtwo.quan.bbs nginx-1.16.1]$ ln -s /usr/local/software/nginx1.16.1 /usr/local/nginx
[root@webtwo.quan.bbs nginx-1.16.1]$ln -s /usr/local/software/nginx1.16.1/sbin/nginx /usr/local/sbin/
我們只需要修改幾個地方
vim /etc/init.d/nginx
#!/bin/sh
#
# nginx- thisscript starts and stops the nginx daemon
#
# chkconfig:- 85 15# description: NGINXisan HTTP(S) server, HTTP(S) reverse \
# proxy and IMAP/POP3 proxy server
# processname: nginx
# config:/usr/local/nginx/conf/nginx.conf
# config:/etc/sysconfig/nginx
# pidfile:/var/run/nginx.pid
# Source function library.
./etc/rc.d/init.d/functions
# Source networking configuration.
./etc/sysconfig/network
# Check that networkingisup.
["$NETWORKING" = "no" ] && exit 0##########修改nginx執行文件的路徑##########
nginx="/usr/local/nginx/sbin/nginx"prog=$(basename $nginx)
###########修改nginx配置文件路徑########
NGINX_CONF_FILE="/usr/local/nginx/conf/nginx.conf"[-f /etc/sysconfig/nginx ] && . /etc/sysconfig/nginx
lockfile=/var/lock/subsys/nginx
make_dirs() {
# make required directories
user=`$nginx -V 2>&1 | grep "configure arguments:.*--user=" | sed 's/[^*]*--user=\([^ ]*\).*/\1/g' -`if [ -n "$user"]; thenif [ -z "`grep $user /etc/passwd`"]; then
useradd-M -s /bin/nologin $user
fi
options=`$nginx -V 2>&1 | grep 'configure arguments:'`for opt in $options; do
if [ `echo $opt | grep '.*-temp-path'` ]; then
value=`echo $opt | cut -d "=" -f 2`if [ ! -d "$value"]; then
# echo"creating"$value
mkdir-p $value && chown -R $user $value
fi
fi
done
fi
}
start() {
[-x $nginx ] || exit 5[-f $NGINX_CONF_FILE ] || exit 6make_dirs
echo-n $"Starting $prog:"daemon $nginx-c $NGINX_CONF_FILE
retval=$?echo
[ $retval-eq 0 ] &&touch $lockfilereturn$retval
}
stop() {
echo-n $"Stopping $prog:"killproc $prog-QUIT
retval=$?echo
[ $retval-eq 0 ] && rm -f $lockfilereturn$retval
}
restart() {
configtest|| return $?stop
sleep1start
}
reload() {
configtest|| return $?echo-n $"Reloading $prog:"killproc $nginx-HUP
RETVAL=$?echo
}
force_reload() {
restart
}
configtest() {
$nginx-t -c $NGINX_CONF_FILE
}
rh_status() {
status $prog
}
rh_status_q() {
rh_status>/dev/null 2>&1}case "$1" instart)
rh_status_q&& exit 0$1;;
stop)
rh_status_q|| exit 0$1;;
restart|configtest)
$1;;
reload)
rh_status_q|| exit 7$1;;
force-reload)
force_reload
;;
status)
rh_status
;;
condrestart|try-restart)
rh_status_q|| exit 0;;*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload|configtest}"exit2esac
設置自啟動nginx
[root@webone.quan.bbs tmp]$chmod 755 /etc/init.d/nginx
[root@webone.quan.bbs tmp]$chkconfig--add nginx
[root@webone.quan.bbs tmp]$chkconfig nginx on
[root@webone.quan.bbs tmp]$service nginx start
[root@webone.quan.bbs tmp]$ps aux|grep nginx
nginx96581 0.0 1.2 123832 12360 ? S 00:00 0:03 php-fpm: pool www
nginx96582 0.0 0.9 121444 9624 ? S 00:00 0:03 php-fpm: pool www
root98610 0.0 0.1 46972 1228 ? Ss 20:37 0:00 nginx: master process /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
nginx98612 0.0 0.2 47436 2288 ? S 20:37 0:00 nginx: worker process
測試nginx是否成功:
客服端訪問出現nginx首頁即可
PHP install??192.168.111.141
[root@webone.quan.bbs packages]$tar -zvxf php-7.3.14.tar.gz
[root@webone.quan.bbs packages]$cd php-7.3.14
./configure --prefix=/usr/local/software/php7.3.14 \
--with-fpm-user=nginx \
--with-fpm-group=nginx \
--with-curl \
--with-freetype-dir \
--with-gd \
--with-png-dir \
--with-jpeg-dir \
--with-gettext \
--with-iconv-dir \
--with-kerberos \
--with-libdir=lib64 \
--with-libxml-dir \
--with-mysqli \
--with-openssl \
--with-pcre-regex \
--with-pdo-mysql \
--with-pdo-sqlite \
--with-pear \
--with-xmlrpc \
--with-xsl \
--with-zlib \
--with-bz2 \
--with-mhash \
--enable-fpm \
--enable-bcmath \
--enable-libxml \
--enable-inline-optimization \
--enable-mbregex \
--enable-mbstring \
--enable-opcache \
--enable-pcntl \
--enable-shmop \
--enable-soap \
--enable-sockets \
--enable-sysvsem \
--enable-sysvshm \
--enable-xml \
--enable-zip \
--enable-ctype\
--enable-fpm
編譯可能出現的問題
1111
錯誤
checkingforXSL support... yes
configure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0distribution
解決:
yum-y install libxslt libxslt-devel
2222
錯誤
checkingforlibzip... not found
configure: error: Please reinstall the libzip distribution
解決:
這里不能這樣子安裝yum install-y libzip libzip-devel yum安裝的版本低,不能用yum安裝下載 libzip-1.4.0.tar.gz (需要cmake 3.0以上) yum install cmake yum安裝的版本低,不能用yum安裝
先安裝cmake高版本:卸載原有的yum -y remove cmake
下載包:
[root@webone.quan.bbs packages]$ curl-O https://cmake.org/files/v3.6/cmake-3.6.0-Linux-x86_64.tar.gz
[root@webone.quan.bbs packages]$tar -zxvf cmake-3.6.0-Linux-x86_64.tar.gz -C /usr/local/software/cmake
[root@webone.quan.bbs packages]$ln-s /usr/local/software/cmake/cmake-3.6.0-Linux-x86_64/bin/cmake /usr/bin/注意:這個壓縮包不是源碼包,解壓后直接用。
2222的第二步:正式安裝libzip
[root@webtwo.quan.bbs packages]$wget https://libzip.org/download/libzip-1.4.0.tar.gz
[root@webtwo.quan.bbs packages]$tar -zxvf libzip-1.4.0.tar.gz
[root@webtwo.quan.bbs packages]$cd libzip-1.4.0[root@webtwo.quan.bbs packages]$mkdir build
[root@webtwo.quan.bbs packages]$cd build
[root@webtwo.quan.bbs packages]$cmake ..
[root@webtwo.quan.bbs packages]$make&& make install
33333
錯誤:
error: off_t undefined; check your library configuration
解決:
[root@webtwo.quan.bbs packages]$ vim/etc/ld.so.conf
添加以下內容:/usr/local/lib64/usr/local/lib/usr/lib/usr/lib64
[root@webtwo.quan.bbs packages]$ldconfig-v 立即生效
4444
錯誤:
file includedfrom /root/download/php-7.3.0/ext/zip/php_zip.h:31:0,from /root/download/php-7.3.0/ext/zip/php_zip.c:36:/usr/local/include/zip.h:59:21: fatal error: zipconf.h: No such file or directory
#include
^compilation terminated.
make:*** [ext/zip/php_zip.lo] Error 1解決:
cp/usr/local/lib/libzip/include/zipconf.h /usr/local/include/zipconf.h
編譯成功后
[root@webtwo.quan.bbs packages]$make && make install
建立軟連接+復制配置文件:
[root@webtwo.quan.bbs packages]$ ln -s /usr/local/software/php7.3.14 /usr/local/php
[root@webtwo.quan.bbs packages]$cp/usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
[root@webtwo.quan.bbs packages]$cp/usr/local/php/etc/php-fpm.d/www.conf.default /usr/local/php/etc/php-fpm.d/www.conf
[root@webtwo.quan.bbs packages]$cd php-7.3.14[root@webtwo.quan.bbs php-7.3.14]$cp php.ini-production /usr/local/php/lib/php.ini
由于編譯的時候沒有設置默認配置文件路徑/usr/local/php/lib 默認配置文件路徑
cp php.ini-production /usr/local/php/lib/php.ini
# 拷貝php-fpm進程服務的配置文件和擴展配置文件
cp/usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
cp/usr/local/php/etc/php-fpm.d/www.conf.default /usr/local/php/etc/php-fpm.d/www.conf
建立軟連接 使命令支持
[root@webone.quan.bbs packages]$ ln -s /usr/local/php/bin/php /usr/bin/
加入服務,開機自啟動:
[root@webone.quan.bbs packages]$cp /data/packages/php-7.3.14/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm[root@webone.quan.bbs packages]$chmod+x /etc/init.d/php-fpm
[root@webone.quan.bbs packages]$service php-fpm start
[root@webone.quan.bbs packages]$chkconfig php-fpm on
檢測:
[root@webone.quan.bbs tmp]$ps aux |grep nginx
nginx96581 0.0 1.2 123832 12360 ? S 00:00 0:03 php-fpm: pool www
nginx96582 0.0 0.9 121444 9624 ? S 00:00 0:03 php-fpm: pool www
root98610 0.0 0.1 46972 1228 ? Ss 20:37 0:00 nginx: master process /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
nginx98612 0.0 0.2 47436 2288 ? S 20:37 0:00 nginx: worker process
nginx 和php 結合:
phpinfo()出現的問題:
1111
發現Loaded Configuration File => (none),表明沒有載入php.ini文件
使用strace 追蹤:
strace /usr/local/php7/sbin/php-fpm -i 2>1.log
vim 1.log 查看php.ini
發現
[root@webone.quan.bbs tmp]$php -i |grep php.ini
Configuration File (php.ini) Path => /usr/local/software/php7.3.14/lib
Loaded Configuration File => /usr/local/software/php7.3.14/lib/php.ini
將php.ini拷貝過去就行了
Mysql install 在主機192.168.111.151上操作
yum install openssl-devel -y
yum install -y ncurses-devel
先建立文件目錄
mkdir-p /usr/local/software/mysql-5.7.29mkdir-p /data/mysql/data
mkdir-p /data/mysql/logs
mkdir-p /data/mysql/pids
[root@mysql.quan.bbs packages]$tar-zxvf mysql-boost-5.7.29.tar.gz
[root@mysql.quan.bbs packages]$cd mysql-5.7.29[root@mysql.quan.bbs mysql-5.7.29]$cmake \
-DCMAKE_INSTALL_PREFIX=/usr/local/software/mysql-5.7.29 \
-DMYSQL_DATADIR=/data/mysql/data \
-DMYSQL_UNIX_ADDR=/data/mysql/mysql.sock \
-DMYSQL_TCP_PORT=3306 \
-DSYSCONFDIR=/usr/local/software/mysql-5.7.29/etc \
-DMYSQL_USER=mysql \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITH_FEDERATED_STORAGE_ENGINE=1 \
-DWITH_MEMORY_STORAGE_ENGINE=1 \
-DENABLED_LOCAL_INFILE=1 \
-DWITH_EMBEDDED_SERVER=1 \
-DWITH_EDITLINE=bundled \
-DWITH_READLINE=1 \
-DENABLE_DOWNLOADS=1 \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DEXTRA_CHARSETS=all \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DWITH_DEBUG=0 \
-DENABLE_DTRACE=0 \
-DMYSQL_MAINTAINER_MODE=0 \
-DWITH_ZLIB:STRING=bundled \
-DDOWNLOAD_BOOST=1 \
-DWITH_BOOST=./boost\
-DWITH_SSL=system
編譯成功后:
[root@mysql.quan.bbs mysql-5.7.29]$ make &&make install
安裝成功后,一如既往的建立軟連接:
ln -s /usr/local/software/mysql-5.7.29 /usr/local/mysql
編寫配置文件my,cnf
注意:再mysql5.7.18之后就源碼包里面就沒有mysql 配置文件的模板了
可以yum 安裝一個mysql ,將/etc/my.cnf復制來修改即可(記得卸載mysql)
vim??/usr/local/software/mysql-5.7.29/etc/my.cnf(因為編譯安裝的時候指定配置文件目錄)
[client]
port= 3306socket= /data/mysql/data/mysql.sockdefault-character-set =utf8
[mysqld]
port= 3306socket= /data/mysql/data/mysql.sock
basedir= /usr/local/mysql
datadir= /data/mysql/data
pid-file = /data/mysql/pids/mysql.pid
user=mysql
bind-address = 0.0.0.0server-id = 1init-connect = 'SET NAMES utf8'character-set-server =utf8
#skip-name-resolve
#skip-networking
back_log= 300max_connections= 1000max_connect_errors= 6000open_files_limit= 65535table_open_cache= 128max_allowed_packet=4M
binlog_cache_size=1M
max_heap_table_size=8M
tmp_table_size=16M
read_buffer_size=2M
read_rnd_buffer_size=8M
sort_buffer_size=8M
join_buffer_size=8M
key_buffer_size=4M
thread_cache_size= 8query_cache_type= 1query_cache_size=8M
query_cache_limit=2M
ft_min_word_len= 4ft_min_word_len= 4log_bin= mysql-bin
binlog_format=mixed
expire_logs_days= 30log_error= /data/mysql/logs/mysql-error.log
slow_query_log= 1long_query_time= 1slow_query_log_file= /data/mysql/logs/mysql-slow.log
performance_schema= 0explicit_defaults_for_timestamp
#lower_case_table_names= 1skip-external-locking
default_storage_engine=InnoDB
#default-storage-engine =MyISAM
innodb_file_per_table= 1innodb_open_files= 500innodb_buffer_pool_size=64M
innodb_write_io_threads= 4innodb_read_io_threads= 4innodb_thread_concurrency= 0innodb_purge_threads= 1innodb_flush_log_at_trx_commit= 2innodb_log_buffer_size=2M
innodb_log_file_size=32M
innodb_log_files_in_group= 3innodb_max_dirty_pages_pct= 90innodb_lock_wait_timeout= 120bulk_insert_buffer_size=8M
myisam_sort_buffer_size=8M
myisam_max_sort_file_size=10G
myisam_repair_threads= 1interactive_timeout= 28800wait_timeout= 28800[mysqldump]
quick
max_allowed_packet=16M
[myisamchk]
key_buffer_size=8M
sort_buffer_size=8M
read_buffer=4M
write_buffer= 4M
加入服務,開機自啟動:
[root@mysql.quan.bbs mysql-5.7.29]$
cp/usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
[root@mysql.quan.bbs mysql-5.7.29]$chmod +x /etc/init.d/mysqld
[root@mysql.quan.bbs mysql-5.7.29]$chkconfig --add mysqld
[root@mysql.quan.bbs mysql-5.7.29]$chkconfig mysqld on
[root@mysql.quan.bbs mysql-5.7.29]$chkconfig --list |grep mysqld
mysqld0:off 1:off 2:on 3:on 4:on 5:on 6:off
修改數據庫數據目錄權限
[root@mysql.quan.bbs mysql-5.7.29]$chown -R mysql:mysql /data/mysql
數據庫初始化:
[root@mysql.quan.bbs mysql-5.7.29]$/usr/local/mysql/bin/mysqld --initialize-insecure --user=mysql --basedir=/usr/local/mysql --datadir=/data/mysql/data
[root@mysql.quan.bbs mysql-5.7.29]$service mysqld start
Starting MySQL. SUCCESS!測試
[root@mysql.quan.bbs mysql-5.7.29]$netstat -tunlp |grep mysql
tcp0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 90317/mysqld
第一次登陸,修改root密碼并設計論壇所需的數據庫和權限
[root@mysql.quan.bbs pids]$/usr/local/mysql/bin/mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection idis 2Server version:5.7.29-log Source distribution
Copyright (c)2000, 2020, Oracle and/or its affiliates. All rights reserved.
Oracleis a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type'help;' or '\h' for help. Type '\c'to clear the current input statement.
mysql>show databases;+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
4 rows in set (0.00sec)
mysql>use mysql
Reading table informationforcompletion of table and column names
You can turn offthis feature to get a quicker startup with -A
Database changed
mysql> select host,user,authentication_string fromuser;+-----------+---------------+-------------------------------------------+
| host | user | authentication_string |
+-----------+---------------+-------------------------------------------+
| localhost | root | |
| localhost | mysql.session | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE |
| localhost | mysql.sys | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE |
+-----------+---------------+-------------------------------------------+
3 rows in set (0.00sec)
mysql> UPDATE user SET authentication_string=PASSWORD('2004') WHERE user='root';
Query OK,1 row affected, 1 warning (0.00sec)
Rows matched:1 Changed: 1 Warnings: 1mysql>flush privileges;
Query OK,0 rows affected (0.01sec)
mysql> quit
[root@mysql.quan.bbs pids]$/usr/local/mysql/bin/mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection idis 4Server version:5.7.29-log Source distribution
Copyright (c)2000, 2020, Oracle and/or its affiliates. All rights reserved.
Oracleis a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type'help;' or '\h' for help. Type '\c'to clear the current input statement.
mysql>create databases quanbbs;
ERROR1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'databases quanbbs' at line 1mysql>create database quanbbs;
Query OK,1 row affected (0.00sec)
mysql> grant all on quanbbs.* to bbsquan@'%' identified by '2004quan';
Query OK,0 rows affected, 1 warning (0.01sec)
mysql>flush privileges;
Query OK,0 rows affected (0.00sec)
mysql> exit
數據庫為quanbbs
用戶為bbsquan
密碼為2004quan
安裝mysql可能出現的問題:
1111問題:
[root@ansz.quan.bbs etc]$service mysqld start
Starting MySQL... ERROR! The server quit without updating PID file (/data/mysql/pids/mysql.pid).
[root@ansz.quan.bbs etc]$service mysqld status
ERROR! MySQL is not running, but lock file (/var/lock/subsys/mysql) exists
[root@ansz.quan.bbs etc]$service mysqld stop
ERROR! MySQL server PID file could not be found!
解決:
第一步建議查看/etc/my.cnf 因為我的編譯的配置文件路徑不是默認路徑
以防萬一,把他刪了
第二部:建議查看系統是否自帶安裝了mysql ,卸載掉即可
第三步:系統可能已經存在正在運行的mysql 相關的程序,將其關掉
[root@ansz.quan.bbs etc]$ps aux|grep mysql
root1280 0.0 0.1 108320 1660 ? S 21:37 0:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/data/mysql/data --pid-file=/data/mysql/pids/mysql.pid
mysql2197 0.0 4.9 929780 49432 ? Sl 21:37 0:00 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/data/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/var/log/mysqld.log --open-files-limit=65535 --pid-file=/data/mysql/pids/mysql.pid --socket=/data/mysql/data/mysql.sock --port=3306root5932 0.0 0.0 103328 892 pts/0 S+ 21:46 0:00grep mysql
[root@ansz.quan.bbs etc]$kill-9 1280[root@ansz.quan.bbs etc]$ps aux|grep mysql
mysql2197 0.0 4.9 929780 49432 ? Sl 21:37 0:00 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/data/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/var/log/mysqld.log --open-files-limit=65535 --pid-file=/data/mysql/pids/mysql.pid --socket=/data/mysql/data/mysql.sock --port=3306root5934 0.0 0.0 103328 892 pts/0 S+ 21:46 0:00grep mysql
[root@ansz.quan.bbs etc]$kill-9 2197[root@ansz.quan.bbs etc]$ps aux|grep mysql
root5936 0.0 0.0 103324 884 pts/0 S+ 21:46 0:00grep mysql
kill-9表示強制殺死該進程,這個信號不能被捕獲也不能被忽略!!!
22222問題:
可能編譯的時候,因為有參數:-DDOWNLOAD_BOOST=1\
所以會在線下載文件boost_1_59_0.tar.gz
而這個文件的源有時載率是很低的,根本下載不了,所以只能大家多試幾次了
解決:
其實因為我下載的myql版本是自帶的,所以不需要加上面的參數-DDOWNLOAD_BOOST=1
然后直接編譯就行了,哈哈哈哈哈哈哈哈哈哈哈
333問題:
[root@ansz.quan.bbs mysql]$/usr/local/mysql/bin/mysqld --initialize-insecure --user=mysql --basedir=/usr/local/mysql --datadir=/data/mysql/data2020-02-10T13:30:23.930494Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation formore details).2020-02-10T13:30:24.132226Z 0 [Warning] InnoDB: New log files created, LSN=45790
2020-02-10T13:30:24.163758Z 0[Warning] InnoDB: Creating foreign key constraint system tables.2020-02-10T13:30:24.233165Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 7e1aeab8-4c09-11ea-b242-000c2914182e.2020-02-10T13:30:24.235679Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed'cannot be opened.2020-02-10T13:30:24.577125Z 0 [Warning] CA certificate ca.pem isself signed.2020-02-10T13:30:24.608491Z 1 [Warning] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
解決:
此處是因為我的配置文件建立的路徑錯誤,導致初始化出現警告
但是是成功初始化的,因為i我的/etc/my.cnf是存在的,所以只警告
將/etc/my.cnf刪除在,建立對的配置文件
注意:將數據庫相關目錄進行清空在初始化
本案例中包括/data/mysql/data 的文件/data/mysql/logs的文件/data/mysql/pids的文件
discuz install?192.168.111.141
wget https://files.gitee.com/group1/M00/0A/98/wKgCNF3jszaAR3zfALQPsgJPd6k089.zip?token=ee59878992389b345910fdafae2c1ad2&ts=1581158202&attname=Discuz_X3.4_SC_UTF8%E3%80%9020191201%E3%80%91.zip&disposition=attachment
建立網址目錄
[apps@webone.quan.bbs etc]$cd/usr/local/nginx/html/[apps@webone.quan.bbs html]$mkdir bbs
解壓:
[root@webone.quan.bbs Discuz]$unzip Discuz_X3.4_SC_UTF8【20191201】.zip
將upload目錄下的所有文件上傳到bbs中
[root@webone.quan.bbs packages]$
cp-r /data/packages/Discuz/upload/*/usr/local/nginx/html/bbs/
修改nginx配置文件:
user nginx nginx;
worker_processes1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections1024;
}
http {
include mime.types;
default_type application/octet-stream;
#log_format main'$remote_addr - $remote_user [$time_local] "$request"'#'$status $body_bytes_sent "$http_referer"'#'"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout0;
keepalive_timeout65;
#gzip on;
server {
listen80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
####修改這里,原來的location 可以不要了
index index.html index.htm index.php;
root/usr/local/nginx/html/bbs;
#error_page404 /404.html;
# redirect server error pages to thestatic page /50x.html
#
error_page500 502 503 504 /50x.html;
location= /50x.html {
root html;
}
# proxy the PHP scripts to Apache listening on127.0.0.1:80#
#location~\.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on127.0.0.1:9000#
location~\.php$ {
fastcgi_pass127.0.0.1:9000;
fastcgi_index index.php;
####修改這里
fastcgi_param SCRIPT_FILENAME/usr/local/nginx/html/bbs/$fastcgi_script_name;
include fastcgi_params;
}
# deny access to .htaccess files,if Apache's document root
# concurs with nginx's one
#
#location~ /\.ht {
# deny all;
#}
}
# anothervirtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen8000;
# listen somename:8080;
# server_name somename alias another.alias;
# location/{
# root html;
# index index.html index.htm;
# }
#}
# HTTPS server
#
#server {
# listen443ssl;
# server_name localhost;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;
# ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 5m;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;
# location/{
# root html;
# index index.html index.htm;
# }
#}
}
重啟生效:
service nginx restart
總體測試
數據庫配置階段(需結合剛才數據庫設置填寫)
如下:
管理密碼QQQQ2004
最后成功啦:
總結
以上是生活随笔為你收集整理的lnp和mysql分开安装_毕业设计之LNP+DISCUZ +分离的数据库操作的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 伞兵打一成语 伞兵打一成语答案
- 下一篇: python窗口居中_Python: t