LNMP

*源码安装 Nginx

[root@server1 ~]# tar zxf nginx-1.12.0.tar.gz
[root@server1 ~]# ls
anaconda-ks.cfg  install.log.syslog  nginx-1.12.0.tar.gz
install.log      nginx-1.12.0
[root@server1 ~]# cd nginx-1.12.0
[root@server1 nginx-1.12.0]# cd src/core/
[root@server1 core]# vim nginx.h
.....
14 #define NGINX_VER          "nginx/"
.....
[root@server1 cc]# pwd
/root/nginx-1.12.0/auto/cc
[root@server1 cc]# vim gcc 
.....
171 # debug
172 CFLAGS="$CFLAGS -g" >>>>> 172 #CFLAGS="$CFLAGS -g"
.....
[root@server1 nginx-1.12.0]# ./configure --prefix=/usr/local/lnmp/nginx --with-http_ssl_module --with-http_stub_status_module --with-threads --with-file-aio
[root@server1 nginx-1.12.0]# make && make install
[root@server1 nginx-1.12.0]# cd /usr/local/lnmp/nginx/
[root@server1 nginx]# cd sbin/
[root@server1 sbin]# ln -s /usr/local/lnmp/nginx/sbin/nginx /usr/local/sbin/
[root@server1 sbin]# which nginx 
/usr/local/sbin/nginx
[root@server1 sbin]# nginx -t
nginx: the configuration file /usr/local/lnmp/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/lnmp/nginx/conf/nginx.conf test is successful
[root@server1 sbin]# netstat -antlp | grep :80
[root@server1 sbin]# nginx 
[root@server1 sbin]# netstat -antlp | grep :80
tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN      1071/nginx          
[root@server1 sbin]#

*此时可通过浏览器访问到 nginx 页面

这里写图片描述

*进程数修改和CPU个数相对应

[root@server1 sbin]# vim /usr/local/lnmp/nginx/conf/nginx.conf  |Nginx主配置文件
.....
2 #user  nobody;        
3 worker_processes  2;      |进程数一般和 CUP 个数一致
4 worker_cpu_affinity 01 02;|绑定CPU
.....
36     server {
37         listen       80;         |监听端口
38         server_name  localhost;  |域名
39 
40         #charset koi8-r;
41 
42         #access_log  logs/host.access.log  main;
43 
44         location / {             
45             root   html;         |默认读取文件的上层目录
46             index  index.html index.htm;|默认读取文件
47         }

......

[root@server1 sbin]# nginx -t   |检测配置文件是否有语法错误
nginx: the configuration file /usr/local/lnmp/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/lnmp/nginx/conf/nginx.conf test is successful
[root@server1 sbin]# nginx -s reload
[root@server1 sbin]# lscpu      |查看 CUP 相关参数
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                1
On-line CPU(s) list:   0
Thread(s) per core:    1
Core(s) per socket:    1
Socket(s):             1
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 61
Stepping:              2
CPU MHz:               2399.998
BogoMIPS:              4799.99
Hypervisor vendor:     KVM
Virtualization type:   full
L1d cache:             32K
L1i cache:             32K
L2 cache:              4096K
NUMA node0 CPU(s):     0
[root@server1 sbin]#

*限制用户访问量

[root@server1 conf]# sysctl -a | grep file
fs.file-nr = 448    0   47340
fs.file-max = 47340

[root@server1 conf]# vim /etc/security/limits.conf 
.....
#
nginx           -       nproc           4096
nginx           -       nofile          4096
....
[root@server1 conf]# vim nginx.conf
.....
events {
    worker_connections  1024;
}
.....

*虚拟主机

[root@server1 conf]# pwd
/usr/local/lnmp/nginx/conf
[root@server1 conf]# vim nginx.conf
.....
118     server {
119         listen       80;
120         server_name  www.xmj.com;
121         location / {
122             root   /web1;
123             index  index.html;
124         }
125  }
.....
[root@server1 conf]# nginx -t
nginx: the configuration file /usr/local/lnmp/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/lnmp/nginx/conf/nginx.conf test is successful
[root@server1 conf]# nginx -s reload
[root@server1 conf]# mkdir /web1
[root@server1 conf]# vim /web1/index.html
[root@server1 conf]# cat /web1/index.html
The weater is so good today!
[root@server1 conf]# 

注:此时需要在物理机上做域名解析 vim /etc/hosts

*通过浏览器访: www.xmj.com

这里写图片描述

*通过 https 访问

[root@server2 sbin]# cd /etc/pki/tls/certs/
[root@server2 certs]# make cert.pem
umask 77 ; \
    PEM1=`/bin/mktemp /tmp/openssl.XXXXXX` ; \
    PEM2=`/bin/mktemp /tmp/openssl.XXXXXX` ; \
    /usr/bin/openssl req -utf8 -newkey rsa:2048 -keyout $PEM1 -nodes -x509 -days 365 -out $PEM2 -set_serial 0 ; \
    cat $PEM1 >  cert.pem ; \
    echo ""    >> cert.pem ; \
    cat $PEM2 >> cert.pem ; \
    rm -f $PEM1 $PEM2
Generating a 2048 bit RSA private key
.......+++
..................................................................................................................+++
writing new private key to '/tmp/openssl.vfg92D'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [XX]:CN
State or Province Name (full name) []:Shaanxi
Locality Name (eg, city) [Default City]:xi'an
Organization Name (eg, company) [Default Company Ltd]:
Organizational Unit Name (eg, section) []:
Common Name (eg, your name or your server's hostname) []:
Email Address []:1552897819@qq.com
[root@server2 certs]# mv cert.pem /usr/local/lnmp/nginx/conf/
[root@server2 certs]# cd /usr/local/lnmp/nginx/conf/
[root@server2 conf]# vim nginx.conf
......
98     server {
99         listen       443 ssl;
100         server_name  localhost;
101 
102         ssl_certificate      cert.pem;
103         ssl_certificate_key  cert.pem;---->(cert.key---cert.pem)
104 
105         ssl_session_cache    shared:SSL:1m;
106         ssl_session_timeout  5m;
107 
108         ssl_ciphers  HIGH:!aNULL:!MD5;
109         ssl_prefer_server_ciphers  on;
110 
111         location / {
112             root   html;
113             index  index.html index.htm;
114         }
115     }
.....

[root@server2 conf]# nginx -t
nginx: the configuration file /usr/local/lnmp/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/lnmp/nginx/conf/nginx.conf test is successful
[root@server2 conf]# nginx -s reload

这里写图片描述
*地址重写

[root@server2 conf]# vim nginx.conf
.....
117     server {
118         listen       80;
119         server_name  www.xmj.com;
120         rewrite ^(.*) https://$server_name$1 permanent;
121         location / {
122             root   /web1;
123             index  index.html index.htm;
124         }
125   }
.....
[root@server2 conf]# nginx -t
nginx: the configuration file /usr/local/lnmp/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/lnmp/nginx/conf/nginx.conf test is successful
[root@server2 conf]# nginx -s reload

*实现 www.xmj.com ---> https://www.xmj.com 的跳转

这里写图片描述
2.安装 Mysql

Mysql和nginx安装有所不同

[root@server1 ~]#  tar zxf mysql-boost-5.7.17.tar.gz 
[root@server1 ~]# du -sh mysql-5.7.17/
542M    mysql-5.7.17/
[root@server1 ~]# cd mysql-5.7.17/
[root@server1 mysql-5.7.17]# ls
boost            Doxyfile-perfschema  mysql-test  storage
BUILD            extra                mysys       strings
client           include              mysys_ssl   support-files
cmake            INSTALL              packaging   testclients
CMakeLists.txt   libbinlogevents      plugin      unittest
cmd-line-utils   libbinlogstandalone  rapid       VERSION
config.h.cmake   libevent             README      vio
configure.cmake  libmysql             regex       win
COPYING          libmysqld            scripts     zlib
dbug             libservices          sql
Docs             man                  sql-common
[root@server1 ~]# yum install cmake-2.8.12.2-4.el6.x86_64.rpm
[root@server1 ~]# yum install gcc-c++ -y
[root@server1 mysql-5.7.17]# yum install bison -y
[root@server1 mysql-5.7.17]# yum install ncurses-devel -y
[root@server1 mysql-5.7.17]# rm -fr CMakeCache.txt 
[root@server1 mysql-5.7.17]# cmake -DCMAKE_INSTALL_PREFIX=/usr/local/lnmp/mysql -DMYSQL_DATADIR=/usr/local/lnmp/mysql/data -DMYSQL_UNIX_ADDR=/usr/local/lnmp/mysql/data/mysql.sock -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_PARTITION_STORAGE_ENGINE=1 -DENABLED_LOCAL_INFILE=1 -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DEXTRA_CHARSETS=all -DWITH_BOOST=boost/boost_1_59_0/
.....
-- Configuring done
-- Generating done
-- Build files have been written to: /root/mysql-5.7.17
.....
[root@server1 mysql-5.7.17]# make
[root@server1 mysql-5.7.17]# make install
[root@server1 mysql-5.7.17]# cd /usr/local/lnmp/mysql/
[root@server1 mysql]# cp /etc/my.cnf /etc/my.cnf.bak
[root@server1 mysql]# cd support-files/
[root@server1 support-files]# cp my-default.cnf /etc/my.cnf
cp: overwrite `/etc/my.cnf'? y
[root@server1 support-files]# cp mysql.server /etc/init.d/mysqld
[root@server1 support-files]# 

[root@server1 support-files]# useradd -u 27 -s /sbin/nologin  mysql
[root@server1 support-files]# groupmod -g 27 mysql

[root@server1 support-files]# vim ~/.bash_profile 
.....
10 PATH=$PATH:$HOME/bin

10 PATH=$PATH:$HOME/bin:/usr/local/lnmp/mysql/bin
.....

[root@server1 support-files]# source ~/.bash_profile 
[root@server1 support-files]# mysql_install_db  --user=mysql --basedir=/usr/local/lnmp/mysql/ --datadir=/usr/local/lnmp/mysql/data
.....
2017-05-14 13:58:56 [WARNING] mysql_install_db is deprecated. Please consider switching to mysqld --initialize
2017-05-14 13:59:33 [WARNING] The bootstrap log isn't empty:
2017-05-14 13:59:33 [WARNING] 2017-05-14T05:58:56.760133Z 0 [Warning] --bootstrap is deprecated. Please consider using --initialize instead
2017-05-14T05:58:56.785042Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)
2017-05-14T05:58:56.785069Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)
.....

[root@server1 mysql]# cd /usr/local/lnmp/mysql/data/
[root@server1 data]# ls
auto.cnf    client-cert.pem  ibdata1      performance_schema  sys
ca-key.pem  client-key.pem   ib_logfile0  server-cert.pem
ca.pem      client-req.pem   ib_logfile1  server-key.pem
ca-req.pem  ib_buffer_pool   mysql        server-req.pem
[root@server1 data]# rm -fr *

[root@server1 data]# mysqld --initialize
.....
2017-05-14T06:05:15.919363Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-05-14T06:05:15.919410Z 0 [Warning] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
2017-05-14T06:05:15.919414Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set.
2017-05-14T06:05:18.303728Z 0 [Warning] InnoDB: New log files created, LSN=45790
2017-05-14T06:05:18.876311Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2017-05-14T06:05:19.119406Z 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: 4eb47175-386b-11e7-be31-525400da723e.
2017-05-14T06:05:19.168045Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2017-05-14T06:05:19.168552Z 1 [Note] A temporary password is generated for root@localhost: Dx5;44Efq,og
.....

[root@server1 data]# pwd
/usr/local/lnmp/mysql/data
[root@server1 data]# cd -
/usr/local/lnmp/mysql
[root@server1 mysql]# chown mysql.mysql * -R
[root@server1 mysql]# /etc/init.d/mysqld start
Starting MySQL.Logging to '/usr/local/lnmp/mysql/data/server1.err'.
 SUCCESS! 
[root@server1 mysql]# mysql -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 5.7.17

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is 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;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
mysql> alter user root@localhost identified by 'Yakexi+007';    #修改数据库密码
Query OK, 0 rows affected (0.00 sec)

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
4 rows in set (0.00 sec)

mysql> quit
Bye
[root@server1 mysql]#

*安装PHP

[root@server2 ~]# tar -xf php-5.6.20.tar.bz2 
[root@server2 ~]# yum install libmcrypt-2.5.8-9.el6.x86_64.rpm libmcrypt-devel-2.5.8-9.el6.x86_64.rpm gd-devel-2.0.35-11.el6.x86_64.rpm 
[root@server2 ~]#yum install libxml2-devel -y
[root@server1 php-5.6.20]# ./configure --prefix=/usr/local/lnmp/php --with-config-file-path=/usr/local/lnmp/php/etc --with-mysql --with-mysqli --with-pdo-mysql --enable-mysalnd --with-openssl --with-snmp --with-gd --with-zlib --with-curl --with-libxml-dir --with-png-dir --with-jpeg-dir --with-freetype --with-pear --with-gettext --with-gmp --enable-inline-optimization --enable-soap --enable-ftp --enable-sockets --enable-mbstring --enable-fpm --with-fpm-user=nginx --with-fpm-group=nginx --with-mcrypt --with-mhash
[root@server2 php-5.6.20]# yum install curl-devel
[root@server2 php-5.6.20]# yum install gmp-devel -y
[root@server2 php-5.6.20]# yum install net-snmp -y
[root@server2 php-5.6.20]# yum install net-snmp-devel.x86_64 -y

*PHP与Nginx相结合

[root@server1 /]# cd /usr/local/lnmp/php/
[root@server1 php]# ls
bin  etc  include  lib  php  sbin  var
[root@server1 php]# cd etc/
[root@server1 etc]# ls
pear.conf  php-fpm.conf.default
[root@server1 etc]# cp php-fpm.conf.default php-fpm.conf
[root@server1 etc]# cd ~/php-5.6.20/
[root@server1 php-5.6.20]# cp php.ini-production /usr/local/lnmp/php/etc/php.ini
[root@server1 php-5.6.20]# cd /usr/local/lnmp/php/etc/
[root@server1 etc]# ls
pear.conf  php-fpm.conf  php-fpm.conf.default  php.ini
[root@server1 etc]# vim php.ini 
[root@server1 etc]# ll /usr/local/lnmp/mysql/data/mysql.sock
srwxrwxrwx 1 mysql mysql 0 May 14 14:07 /usr/local/lnmp/mysql/data/mysql.sock

[root@server1 etc]# vim php.ini 
.....
925 date.timezone =Asis/Shanghai
.....
1001 pdo_mysql.default_socket=/usr/local/lnmp/mysql/data/mysql.sock
.....
1150 mysql.default_socket =/usr/local/lnmp/mysql/data/mysql.sock
....
1209 mysqli.default_socket =/usr/local/lnmp/mysql/data/mysql.sock

[root@server1 etc]# vim php-fpm.conf
.....
 25 pid = run/php-fpm.pid
.....

[root@server1 etc]# cd ~/php-5.6.20
[root@server1 php-5.6.20]# cd sapi/
[root@server1 sapi]# ls
aolserver  apache2filter   apache_hooks  cgi  continuity  fpm    litespeed  nsapi   phttpd  roxen  thttpd  webjames
apache     apache2handler  caudium       cli  embed       isapi  milter     phpdbg  pi3web  tests  tux
[root@server1 sapi]# cd fpm/
[root@server1 fpm]# ls
config.m4  init.d.php-fpm     Makefile.frag  php-fpm.8.in     php-fpm.service     status.html.in
CREDITS    init.d.php-fpm.in  php-fpm        php-fpm.conf     php-fpm.service.in  tests
fpm        LICENSE            php-fpm.8      php-fpm.conf.in  status.html
[root@server1 fpm]# file init.d.php-fpm
init.d.php-fpm: POSIX shell script text executable
[root@server1 fpm]# cp init.d.php-fpm /etc/init.d/php-fpm
[root@server1 fpm]# chmod +x /etc/init.d/php-fpm 
[root@server1 fpm]# /etc/init.d/php-fpm status
php-fpm is stopped
[root@server1 fpm]# /etc/init.d/php-fpm start
Starting php-fpm  done
.....

此时如果出现错误:
[root@server2 conf]# /etc/init.d/php-fpm start
Starting php-fpm [18-May-2017 15:51:11] ERROR: [pool www] cannot get uid for user 'nginx'
[18-May-2017 15:51:11] ERROR: FPM initialization failed
 failed

原因:
[root@server2 conf]# cd /usr/local/lnmp/php/etc/
[root@server2 etc]# vim  php-fpm.conf
.....
149 user = nginx    #指定用户为nginx
150 group = nginx

因此添加nginx用户即可
.....
[root@server1 fpm]# cd /usr/local/lnmp/nginx/conf/
[root@server1 conf]# vim nginx.conf
.....
45             index  index.php index.html index.htm;
.....
65         location ~ \.php$ {
66             root           html;
67             fastcgi_pass   127.0.0.1:9000;
68             fastcgi_index  index.php;
69             # fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
70          include        fastcgi.conf;
71         }
......

[root@server1 conf]# nginx -t
nginx: the configuration file /usr/local/lnmp/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/lnmp/nginx/conf/nginx.conf test is successful
[root@server1 conf]# nginx -s reload
nginx: [alert] kill(1096, 1) failed (3: No such process)
[root@server1 conf]# nginx
[root@server1 conf]# ls
cert.pem              fastcgi_params          koi-win             nginx.conf          scgi_params.default   win-utf
fastcgi.conf          fastcgi_params.default  mime.types          nginx.conf.default  uwsgi_params
fastcgi.conf.default  koi-utf                 mime.types.default  scgi_params         uwsgi_params.default
[root@server1 conf]# cd -
/root/php-5.6.20/sapi/fpm
[root@server1 fpm]# cd /usr/local/lnmp/nginx/html/
[root@server1 html]# ls
50x.html  index.html
[root@server1 html]# vim index.php
[root@server1 html]# cat index.php 
<?php
phpinfo()
?>
[root@server1 html]#

通过浏览器访问:172.25.66.2

这里写图片描述

论坛

[root@server1 ~]# ls
cmake-2.8.12.2-4.el6.x86_64.rpm    libmcrypt-devel-2.5.8-9.el6.x86_64.rpm  nginx-1.12.0.tar.gz
Discuz_X3.2_SC_UTF8.zip            mysql-5.7.17                            php-5.6.20
gd-devel-2.0.35-11.el6.x86_64.rpm  mysql-boost-5.7.17.tar.gz               php-5.6.20.tar.bz2
libmcrypt-2.5.8-9.el6.x86_64.rpm   nginx-1.12.0                            re2c-0.13.5-1.el6.x86_64.rpm
[root@server1 ~]# yum install unzip -y
[root@server1 ~]# unzip Discuz_X3.2_SC_UTF8.zip 
[root@server1 ~]# ls
cmake-2.8.12.2-4.el6.x86_64.rpm    libmcrypt-devel-2.5.8-9.el6.x86_64.rpm  nginx-1.12.0.tar.gz           readme
Discuz_X3.2_SC_UTF8.zip            mysql-5.7.17                            php-5.6.20                    upload
gd-devel-2.0.35-11.el6.x86_64.rpm  mysql-boost-5.7.17.tar.gz               php-5.6.20.tar.bz2            utility
libmcrypt-2.5.8-9.el6.x86_64.rpm   nginx-1.12.0                            re2c-0.13.5-1.el6.x86_64.rpm
[root@server1 ~]# cd readme/
[root@server1 readme]# ls
changelog.txt  convert.txt  license.txt  readme.txt  upgrade.txt
[root@server1 readme]# less readme.txt 
[root@server1 readme]# cd ..
[root@server1 ~]# mv upload/ /usr/local/lnmp/nginx/html/bbs
[root@server1 ~]# cd  /usr/local/lnmp/nginx/html/bbs/
[root@server1 bbs]# ls
admin.php    cp.php           home.php    portal.php  uc_client
api          crossdomain.xml  index.php   robots.txt  uc_server
api.php      data             install     search.php  userapp.php
archiver     favicon.ico      member.php  source
config       forum.php        misc.php    static
connect.php  group.php        plugin.php  template
[root@server1 bbs]#

在浏览器中访问:172.25.66.2/bbs/install

这里写图片描述

*当出现访问限制时,是因为文件权限不够

这里写图片描述

[root@server1 bbs]# chmod 777 config/ data/ uc_client/ uc_server/ -R

这里写图片描述

*当出现 Permission deny时,是因为 data 权限不够

[root@server2 bbs]# cd /usr/local/lnmp/mysql/
[root@server2 mysql]# ll
total 60
drwxr-xr-x  2 mysql mysql  4096 May 18 01:11 bin
-rw-r--r--  1 mysql mysql 17987 Nov 28 21:32 COPYING
drwxr-x---  5 mysql mysql  4096 May 18 01:29 data
drwxr-xr-x  2 mysql mysql  4096 May 18 01:10 docs
drwxr-xr-x  3 mysql mysql  4096 May 18 01:10 include
drwxr-xr-x  4 mysql mysql  4096 May 18 01:11 lib
drwxr-xr-x  4 mysql mysql  4096 May 18 01:11 man
drwxr-xr-x 10 mysql mysql  4096 May 18 01:12 mysql-test
-rw-r--r--  1 mysql mysql  2478 Nov 28 21:32 README
drwxr-xr-x 28 mysql mysql  4096 May 18 01:12 share
drwxr-xr-x  2 mysql mysql  4096 May 18 01:12 support-files
[root@server2 mysql]# chmod 755 data/
[root@server2 mysql]# 

这里写图片描述

*完成安-登陆(当出现Connection refused时,查看数据库是否start)

这里写图片描述
这里写图片描述

[root@server2 mysql]# mysql -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 23
Server version: 5.7.17 Source distribution

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is 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                |
| ultrax             |
+--------------------+
5 rows in set (0.06 sec)

mysql> use ultrax
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed

mysql> show tables;
+-----------------------------------+
| Tables_in_ultrax                  |
+-----------------------------------+
| pre_common_admincp_cmenu          |
| pre_common_admincp_group          |
| pre_common_admincp_member         |
| pre_common_admincp_perm           |
| pre_common_admincp_session        |
| pre_common_admingroup             |
| pre_common_adminnote              |
| pre_common_advertisement          |
| pre_common_advertisement_custom   |
| pre_common_banned                 |
| pre_common_block                  |
| pre_common_block_favorite         |
| pre_common_block_item             |
| pre_common_block_item_data        |
| pre_common_block_permission       |
| pre_common_block_pic              |
| pre_common_block_style            |
| pre_common_block_xml              |
| pre_common_cache                  |
| pre_common_card                   |
| pre_common_card_log               |
| pre_common_card_type              |
| pre_common_connect_guest          |
| pre_common_credit_log             |
| pre_common_credit_log_field       |
| pre_common_credit_rule            |
| pre_common_credit_rule_log        |
| pre_common_credit_rule_log_field  |
| pre_common_cron                   |
| pre_common_devicetoken            |
| pre_common_district               |
| pre_common_diy_data               |
| pre_common_domain                 |
| pre_common_failedip               |
| pre_common_failedlogin            |
| pre_common_friendlink             |
| pre_common_grouppm                |
| pre_common_invite                 |
| pre_common_magic                  |
| pre_common_magiclog               |
| pre_common_mailcron               |
| pre_common_mailqueue              |
| pre_common_member                 |
| pre_common_member_action_log      |
| pre_common_member_connect         |
| pre_common_member_count           |
| pre_common_member_crime           |
| pre_common_member_field_forum     |
| pre_common_member_field_home      |
| pre_common_member_forum_buylog    |
| pre_common_member_grouppm         |
| pre_common_member_log             |
| pre_common_member_magic           |
| pre_common_member_medal           |
| pre_common_member_newprompt       |
| pre_common_member_profile         |
| pre_common_member_profile_setting |
| pre_common_member_security        |
| pre_common_member_secwhite        |
| pre_common_member_stat_field      |
| pre_common_member_status          |
| pre_common_member_validate        |
| pre_common_member_verify          |
| pre_common_member_verify_info     |
| pre_common_member_wechat          |
| pre_common_member_wechatmp        |
| pre_common_myapp                  |
| pre_common_myinvite               |
| pre_common_mytask                 |
| pre_common_nav                    |
| pre_common_onlinetime             |
| pre_common_optimizer              |
| pre_common_patch                  |
| pre_common_plugin                 |
| pre_common_pluginvar              |
| pre_common_process                |
| pre_common_regip                  |
| pre_common_relatedlink            |
| pre_common_remote_port            |
| pre_common_report                 |
| pre_common_searchindex            |
| pre_common_seccheck               |
| pre_common_secquestion            |
| pre_common_session                |
| pre_common_setting                |
| pre_common_smiley                 |
| pre_common_sphinxcounter          |
| pre_common_stat                   |
| pre_common_statuser               |
| pre_common_style                  |
| pre_common_stylevar               |
| pre_common_syscache               |
| pre_common_tag                    |
| pre_common_tagitem                |
| pre_common_task                   |
| pre_common_taskvar                |
| pre_common_template               |
| pre_common_template_block         |
| pre_common_template_permission    |
| pre_common_uin_black              |
| pre_common_usergroup              |
| pre_common_usergroup_field        |
| pre_common_visit                  |
| pre_common_word                   |
| pre_common_word_type              |
| pre_connect_disktask              |
| pre_connect_feedlog               |
| pre_connect_memberbindlog         |
| pre_connect_postfeedlog           |
| pre_connect_tthreadlog            |
| pre_forum_access                  |
| pre_forum_activity                |
| pre_forum_activityapply           |
| pre_forum_announcement            |
| pre_forum_attachment              |
| pre_forum_attachment_0            |
| pre_forum_attachment_1            |
| pre_forum_attachment_2            |
| pre_forum_attachment_3            |
| pre_forum_attachment_4            |
| pre_forum_attachment_5            |
| pre_forum_attachment_6            |
| pre_forum_attachment_7            |
| pre_forum_attachment_8            |
| pre_forum_attachment_9            |
| pre_forum_attachment_exif         |
| pre_forum_attachment_unused       |
| pre_forum_attachtype              |
| pre_forum_bbcode                  |
| pre_forum_collection              |
| pre_forum_collectioncomment       |
| pre_forum_collectionfollow        |
| pre_forum_collectioninvite        |
| pre_forum_collectionrelated       |
| pre_forum_collectionteamworker    |
| pre_forum_collectionthread        |
| pre_forum_creditslog              |
| pre_forum_debate                  |
| pre_forum_debatepost              |
| pre_forum_faq                     |
| pre_forum_filter_post             |
| pre_forum_forum                   |
| pre_forum_forum_threadtable       |
| pre_forum_forumfield              |
| pre_forum_forumrecommend          |
| pre_forum_groupcreditslog         |
| pre_forum_groupfield              |
| pre_forum_groupinvite             |
| pre_forum_grouplevel              |
| pre_forum_groupuser               |
| pre_forum_hotreply_member         |
| pre_forum_hotreply_number         |
| pre_forum_imagetype               |
| pre_forum_medal                   |
| pre_forum_medallog                |
| pre_forum_memberrecommend         |
| pre_forum_moderator               |
| pre_forum_modwork                 |
| pre_forum_newthread               |
| pre_forum_onlinelist              |
| pre_forum_order                   |
| pre_forum_poll                    |
| pre_forum_polloption              |
| pre_forum_polloption_image        |
| pre_forum_pollvoter               |
| pre_forum_post                    |
| pre_forum_post_location           |
| pre_forum_post_moderate           |
| pre_forum_post_tableid            |
| pre_forum_postcache               |
| pre_forum_postcomment             |
| pre_forum_postlog                 |
| pre_forum_poststick               |
| pre_forum_promotion               |
| pre_forum_ratelog                 |
| pre_forum_relatedthread           |
| pre_forum_replycredit             |
| pre_forum_rsscache                |
| pre_forum_sofa                    |
| pre_forum_spacecache              |
| pre_forum_statlog                 |
| pre_forum_thread                  |
| pre_forum_thread_moderate         |
| pre_forum_threadaddviews          |
| pre_forum_threadcalendar          |
| pre_forum_threadclass             |
| pre_forum_threadclosed            |
| pre_forum_threaddisablepos        |
| pre_forum_threadhidelog           |
| pre_forum_threadhot               |
| pre_forum_threadimage             |
| pre_forum_threadlog               |
| pre_forum_threadmod               |
| pre_forum_threadpartake           |
| pre_forum_threadpreview           |
| pre_forum_threadprofile           |
| pre_forum_threadprofile_group     |
| pre_forum_threadrush              |
| pre_forum_threadtype              |
| pre_forum_trade                   |
| pre_forum_tradecomment            |
| pre_forum_tradelog                |
| pre_forum_typeoption              |
| pre_forum_typeoptionvar           |
| pre_forum_typevar                 |
| pre_forum_warning                 |
| pre_home_album                    |
| pre_home_album_category           |
| pre_home_appcreditlog             |
| pre_home_blacklist                |
| pre_home_blog                     |
| pre_home_blog_category            |
| pre_home_blog_moderate            |
| pre_home_blogfield                |
| pre_home_class                    |
| pre_home_click                    |
| pre_home_clickuser                |
| pre_home_comment                  |
| pre_home_comment_moderate         |
| pre_home_docomment                |
| pre_home_doing                    |
| pre_home_doing_moderate           |
| pre_home_favorite                 |
| pre_home_feed                     |
| pre_home_feed_app                 |
| pre_home_follow                   |
| pre_home_follow_feed              |
| pre_home_follow_feed_archiver     |
| pre_home_friend                   |
| pre_home_friend_request           |
| pre_home_friendlog                |
| pre_home_notification             |
| pre_home_pic                      |
| pre_home_pic_moderate             |
| pre_home_picfield                 |
| pre_home_poke                     |
| pre_home_pokearchive              |
| pre_home_share                    |
| pre_home_share_moderate           |
| pre_home_show                     |
| pre_home_specialuser              |
| pre_home_userapp                  |
| pre_home_userappfield             |
| pre_home_visitor                  |
| pre_mobile_setting                |
| pre_mobile_wechat_authcode        |
| pre_mobile_wechat_masssend        |
| pre_mobile_wechat_resource        |
| pre_mobile_wsq_threadlist         |
| pre_portal_article_content        |
| pre_portal_article_count          |
| pre_portal_article_moderate       |
| pre_portal_article_related        |
| pre_portal_article_title          |
| pre_portal_article_trash          |
| pre_portal_attachment             |
| pre_portal_category               |
| pre_portal_category_permission    |
| pre_portal_comment                |
| pre_portal_comment_moderate       |
| pre_portal_rsscache               |
| pre_portal_topic                  |
| pre_portal_topic_pic              |
| pre_security_evilpost             |
| pre_security_eviluser             |
| pre_security_failedlog            |
| pre_ucenter_admins                |
| pre_ucenter_applications          |
| pre_ucenter_badwords              |
| pre_ucenter_domains               |
| pre_ucenter_failedlogins          |
| pre_ucenter_feeds                 |
| pre_ucenter_friends               |
| pre_ucenter_mailqueue             |
| pre_ucenter_memberfields          |
| pre_ucenter_members               |
| pre_ucenter_mergemembers          |
| pre_ucenter_newpm                 |
| pre_ucenter_notelist              |
| pre_ucenter_pm_indexes            |
| pre_ucenter_pm_lists              |
| pre_ucenter_pm_members            |
| pre_ucenter_pm_messages_0         |
| pre_ucenter_pm_messages_1         |
| pre_ucenter_pm_messages_2         |
| pre_ucenter_pm_messages_3         |
| pre_ucenter_pm_messages_4         |
| pre_ucenter_pm_messages_5         |
| pre_ucenter_pm_messages_6         |
| pre_ucenter_pm_messages_7         |
| pre_ucenter_pm_messages_8         |
| pre_ucenter_pm_messages_9         |
| pre_ucenter_protectedmembers      |
| pre_ucenter_settings              |
| pre_ucenter_sqlcache              |
| pre_ucenter_tags                  |
| pre_ucenter_vars                  |
+-----------------------------------+
297 rows in set (0.00 sec)

mysql> quit
Bye
[root@server2 mysql]# 

——END——

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值