nginx1.10.3+php5.6+mysql5.7.0
第一步安装nginx1.10.3
优化nginx的介绍:jemalloc
https://ideas.spkcn.com/software/os/linux/577.html
预先安装autoconf 和 make
yum -y install autoconf make
jemalloc的安装
jiemalloc 开源项目网站 http://www.canonware.com/jemalloc/
wget https://github.com/jemalloc/jemalloc/releases/jemalloc-4.2.1.tar.bz2
tar -xjf jemalloc-4.2..tar.bz2
cd jemalloc-4.2.
./configure --prefix=/usr/local/jemalloc --libdir=/usr/local/lib
make && make install
make clean
cd ../
echo "/usr/local/lib" > /etc/ld.so.conf.d/usr_local_lib.conf
/sbin/ldconfig 使用jemalloc优化MYSQL数据库
MYSQL或者MariaDB源码编译时添加以下参数
-DCMAKE_EXE_LINKER_FLAGS="-ljemalloc" -DWITH_SAFEMALLOC=OFF
或者编辑mysqld_safe文件直接加载:
查找文件 /usr/local/mysql/bin/mysqld_safe
在# executing mysqld_safe 下面加上 LD_PRELOAD=/usr/local/lib/libjemalloc.so
重新启动MYSQL 使用下面代码自动修改mysqld_safe文件
sed -i 's@executing mysqld_safe@executing mysqld_safe\nexport LD_PRELOAD=/usr/local/lib/libjemalloc.so@' /usr/local/mysql/bin/mysqld_safe service mysqld restart
使用jemalloc优化NGINX
编译NGINX时添加以下参数:
--with-ld-opt="-ljemalloc" 验证 jemalloc 是否运行:
lsof -n | grep jemalloc
这个配置稍后在lnmp第二部分,此处没有mysqld的优化。
nginx基础环境搭建:
service iptables stop
iptables -I INPUT -p tcp --dport -j ACCEPT
vi /etc/sysconfig/selinux
selinux=disabled 创建文件夹
mkdir -p /usr/local/src
cd /usr/local/src 用户
useradd -s /sbin/nologin -M www
groupadd nginx 下载稳定版nginx1.10.3
yum -y install zlib* gcc gcc-c++ libtool openssl* automake autoconf libtool pcre*
wget http://nginx.org/download/nginx-1.10.3.tar.gz
cd nginx-1.10.
./configure --help ./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_v2_module --with-http_gzip_static_module --with-ipv6 --with-http_sub_module --with-ld-opt='-ljemalloc'
--with-ld-opt这个优化的是nginx内存参数。 make && make install
ln -s /usr/local/nginx/sbin/nginx /usr/local/sbin 创建家目录
mkdir -p /home/wwwlogs/
mkdir -p /usr/local/nginx/logs/
将编写好的nginx.conf 拷贝到nginx.conf
创建vhost,并属主属组,
chown -R www:www /home/wwwroot/
mkdir -p /home/wwwroot/ /usr/local/nginx/sbin/nginx
/usr/local/nginx/sbin/nginx -v
/usr/local/nginx/sbin/nginx -t netstat -antpu | grep nginx
curl ip地址 :查看能否正常运行nginx。
关于pid报错的信息,killall - nginx
编写自己启动文档。
[root@test1 html]# cat /usr/local/nginx/conf/nginx.conf
user www www;
worker_processes auto;
#error_log /home/wwwlogs/nginx_error.log crit;
pid /usr/local/nginx/logs/nginx.pid; #Specifies the value for maximum file descriptors that can be opened by this process.
worker_rlimit_nofile ; events
{
use epoll;
worker_connections ;
multi_accept on;
}
http
{
include mime.types;
default_type application/octet-stream;
server_names_hash_bucket_size ;
client_header_buffer_size 32k;
large_client_header_buffers 32k;
client_max_body_size 50m; sendfile on;
tcp_nopush on; keepalive_timeout ;
tcp_nodelay on; fastcgi_connect_timeout ;
fastcgi_send_timeout ;
fastcgi_read_timeout ;
fastcgi_buffer_size 64k;
fastcgi_buffers 64k;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 256k; gzip on;
gzip_min_length 1k;
gzip_buffers 16k;
gzip_http_version 1.1;
gzip_comp_level ;
gzip_types text/plain application/javascript application/x-javascript text/javascript text/css application/xml application/xml+rss;
gzip_vary on;
gzip_proxied expired no-cache no-store private auth;
gzip_disable "MSIE [1-6]\."; #limit_conn_zone $binary_remote_addr zone=perip:10m;
##If enable limit_conn_zone,add "limit_conn perip 10;" to server section. server_tokens off;
access_log off; include vhost/*.conf;
}
在nginx的配置文件中
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000; 该处必须和php-fpm.conf中的lisen一样
#fastcigi_pass /tmp/php-cgi.sock
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
官网下载mysql(该配置文件没有优化mysql内存)
下载MySQL5..20源码包,和boost
wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.20.tar.gz
wget https://sourceforge.net/projects/boost/files/boost/1.59.0/boost_1_59_0.tar.gz/ 添加用户和组MySQL,并且不允许登录
groupadd mysql
usradd -r -g mysql -s /sbin/nologin -M mysql
配置环境,解压包
yum -y install gcc gcc-c++ ncurses ncurses-devel bison libgcrypt perl make cmake
tar -xf mysql-5.7..tar.gz
cd mysql-5.7.
mkdir -p /usr/local/mysql/
mkdir -p /usr/local/boost/
cp boost_1_59_0.tar.gz /usr/local/boost 将包放到boost下
mkdir -p /data/mysql
其中data下的属主和属组必须是mysql,date是数据库目录。
ls /usr/local/mysql
chown -R mysql:mysql /data/mysql cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock -DSYSCONFDIR=/etc -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_MYISAM_STORAGE_ENGINE= -DWITH_INNOBASE_STORAGE_ENGINE= -DWITH_ARCHIVE_STORAGE_ENGINE= -DWITH_BLACKHOLE_STORAGE_ENGINE= -DENABLED_LOCAL_INFILE= -DMYSQL_DATADIR=/data/mysql -DDOWNLOAD_BOOST= -DMYSQL_TCP_PORT= -DENABLE_DOWNLOADS= -DWITH_BOOST=/usr/local/boost -DCMAKE_EXE_LINKER_FLAGS="-ljemalloc" -DWITH_SAFEMALLOC=OFF 此处做优化内容。
make && make install 将安装目录添加到环境变量中:
echo "export PATH=$PATH:/usr/local/mysql/bin">>/etc/profile
source /etc/profile
查看文件错误日志出现这行信息,
说明文件没有初始化,需要删除/data/mysql(数据库目录)下的文档
--18T15::.477533Z [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
--18T15::.477899Z [ERROR] unknown variable 'default-file=/etc/my.cnf'
--18T15::.477915Z [ERROR] Aborting 初始化安装MySQL
cd /data/mysql 每次初始化时都要删除该目录下文件(数据库目录)
rm -rf ./*
/usr/local/mysql/bin/mysqld --initialize-insecure --user=mysql \
--basedir=/usr/local/mysql --datadir=/data/mysql ps aux | grep mysql
会出现如下内容:
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.8/FAQ
mysql 27672 0.1 2.5 914052 49200 pts/1 Sl 00:11 0:00 /usr/local/mysql/bin/mysqld --defaults-file=/etc/my.cnf --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/usr/local/mysql/data/mysql-error.log --open-files-limit=65535 --pid-file=/usr/local/mysql/mysql.pid --socket=/usr/local/mysql/mysql.sock --port=3306
root 27721 0.0 0.0 103260 876 pts/1 S+ 00:15 0:00 grep 3306 6 配置my.cnf
在启动mysql服务时,会按照一定次序搜索my.cnf,先在/etc目录下找,找不到会搜索
$basedir/my.cnf 也就是安装目录,新版的配置文件默认位置。将/etc下的my.cnf备份
否则该文件会影响安装mysql的正确配置,造成无法启动。
cp my-default.cnf /etc/my.cnf
后台启动MySQL /usr/local/mysql/bin/mysqld_safe --defaults-file=/etc/my.cnf &
正常启动后没有其他内容,回车一下就出来了。 查看MySQL是否启动
ps -aux | grep mysql
将启动的MySQL杀死
kill -9 进程号(两个)
只留下一个就好了:root 80654 0.0 0.0 103256 840 pts/1 S+ 08:18 0:00 grep mysql cd /usr/local/mysql/support-files
将其中的mysql-server复制到启动程序下,并改名为mysqld
cp mysql-server /etc/init.d/
mv mysql-server /etc/init.d/mysqld
chmod 755 mysqld 修改vi /etc/init.d/mysqld
basedir=/usr/local/mysql
datadir=/data/mysql 启动程序
/etc/init.d/mysqld restart 设置开机自启
chkconfig mysqld on
chkconfig --add mysqld 修改mysqld的密码
vi /etc/my.cnf
在mysqld下添加:skip-grant-tables
service mysqld restart
mysql -u root -p 此时密码为空
登录并修改mysql的root密码:
>use mysql;
>update user set authentication_string=password('123456') where user='root';
>flush privileges;
>quit
在5.7的版主中原来的password改为:authertication_string
在>select * from mysql.user \G; 中得到。
删除skip-grant-tables
重启服务
mysql -v
关于mysql配置过程中出错的问题
启动MySQL时出错:
/usr/local/mysql/bin/mysqld_safe --defaults-file=/etc/my.cnf &
[1] 32519
[root@slave1 mysql]# 2017-12-20T12:50:13.972444Z mysqld_safe error:
log-error set to '/usr/local/mysql/mysql-error.log',
however file don't exists. Create writable for user 'mysql'.
解决办法:
echo "" > /usr/local/mysql/mysql-error.log
chown -R mysql:mysql /usr/local/mysql/mysql-error.log
/usr/local/mysql/bin/mysqld_safe --defaults-file=/etc/my.cnf &
关于pid的问题
当初始化时会产生一个pid,所以每次读取配置文件都要读取该pid
pid报错时候,用service mysqld restart不能读取,应该用
/usr/local/mysql/bin/mysqld_safe --defaults-file=/etc/my.cnf &
然后从错误的文档中查看。出现的报错信息时间会对不上,找最近的。
关于cmake时报错
CMake Error at cmake/boost.cmake:76 (MESSAGE):
Call Stack (most recent call first):
cmake/boost.cmake:228 (COULD_NOT_FIND_BOOST)
CMakeLists.txt:435 (INCLUDE)
解决方法一:
cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql
-DMYSQL_DATADIR=/usr/local/mysql/data
-DMYSQL_UNIX_ADDR=/usr/local/mysql/tmp/mysql.sock
-DMYSQL_USER=mysql
-DDEFAULT_CHARSET=utf8
-DDEFAULT_COLLATION=utf8_general_ci
-DENABLED_LOCAL_INFILE=ON
-DWITH_INNOBASE_STORAGE_ENGINE=1
-DWITH_FEDERATED_STORAGE_ENGINE=1
-DWITH_BLACKHOLE_STORAGE_ENGINE=1
-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1
-DDOWNLOAD_BOOST=1
-DWITH_BOOST=/usr/local/boost
解决方法二:
下载boost包,放到/usr/local/boost目录下,
cmake后面加选项 -DWITH_BOOST=/usr/local/boost
关于sock问题
2018-01-15T03:10:11.729108Z 0 [ERROR] Could not create unix socket lock file /usr/local/mysql/mysql.sock.lock.
2018-01-15T03:10:11.729117Z 0 [ERROR] Unable to setup unix socket lock file.
尝试给my.cnf备份,然后在将my.cnf中的socket改下路径
vi /etc/my.cnf [root@test1 html]# cat /etc/my.cnf
[client]
port =
socket = /data/mysql/mysql.sock
#default-character-set = utf8mb4
[mysqld]
port =
socket = /data/mysql/mysql.sock
basedir = /usr/local/mysql
datadir = /data/mysql
pid-file = /data/mysql/mysql.pid
user = mysql
bind-address = 0.0.0.0
server-id =
log-bin=/data/mysql/mysql-bin/mysql-bin
relay-log=/data/mysql/relay-bin/relay-bin
slow_query_log_file = /data/mysql/mysql-slow.log
#init-connect = 'SET NAMES utf8mb4'
log_error = /data/mysql/mysql-error.log
character-set-server = utf8mb4
#skip-name-resolve
#skip-networking
#skip-grant-tables
log-slave-updates
binlog_format = mixed
#binlog-ignore-db=mysql,information_schema,sys,performance_schema
default_storage_engine = InnoDB
#default-storage-engine = MyISAM
back_log =
max_connections =
max_connect_errors =
open_files_limit =
table_open_cache =
max_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 =
query_cache_type =
query_cache_size = 8M
query_cache_limit = 2M
ft_min_word_len =
expire_logs_days =
slow_query_log =
long_query_time =
performance_schema =
explicit_defaults_for_timestamp
#lower_case_table_names =
skip-external-locking
innodb_file_per_table =
innodb_open_files =
innodb_buffer_pool_size = 64M
innodb_write_io_threads =
innodb_read_io_threads =
innodb_thread_concurrency =
innodb_purge_threads =
innodb_flush_log_at_trx_commit =
innodb_log_buffer_size = 2M
innodb_log_file_size = 32M
innodb_log_files_in_group =
innodb_max_dirty_pages_pct =
innodb_lock_wait_timeout =
bulk_insert_buffer_size = 8M
myisam_sort_buffer_size = 8M
myisam_max_sort_file_size = 10G
myisam_repair_threads =
interactive_timeout =
wait_timeout =
init-connect = 'SET NAMES utf8mb4'
[mysqldump]
quick
max_allowed_packet = 16M
[myisamchk]
key_buffer_size = 8M
sort_buffer_size = 8M
read_buffer = 4M
write_buffer = 4M
wget http://cn2.php.net/distributions/php-5.6.10.tar.gz
tar -zxvf php-5.6..tar.gz
cd php-5.6.
./configure --help
yum install -y libxml2-devel openssl-devel libcurl-devel libjpeg-devel libpng-devel libicu-devel openldap-devel gcc gcc-c++
yum install -y epel-release
yum -y install libmcrypt libmcrypt-devel freetype-devel
./configure --prefix=/usr/local/php --with-config-file-path=/etc --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-iconv-dir --with-freetype-dir=/usr/local/freetype --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --with-mcrypt --enable-ftp --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --with-gettext --disable-fileinfo make && make install 指定 php 安装目录
--prefix=/usr/local/php # 指定php.ini位置
--with-config-file-path=/etc
# mysql安装目录,对mysql的支持
--with-mysql=/usr/local/mysql find / -name mysql.h 找到mysql.h的路径
/usr/local/mysql/include/mysql.h
/usr/local/src/mysql-5.7./include/mysql.h
/usr/local/src/mysql-5.7./rapid/plugin/x/mysqlxtest_src/mysqlx/mysql.h --with-mysql=/usr #这是mysql相关编译路径,这里网上很多都是--with-mysql=/usr/share/mysql,但我这样做,编译完提示一个error,Cannot find MySQL header files under /usr/share/mysql ,经查,有的说是因为64位电脑的原因,此处正确写法是 先 用 find / -name mysql.h 找到mysql.h的路径,然后写该路径的前缀。比如我电脑搜出来路径/usr/local/mysql/include/mysql.h ,所以前缀是 /usr/local/mysql --with-mysql-sock --with-mysqli=
# 这应该是mysqli 编译配置,后面的参数可以先 find / -name mysql_config
/usr/local/mysql/bin/mysql_config
/usr/local/src/mysql-5.7./scripts/mysql_config --enable-fpm # 开启php-fpm 功能
cp php.ini-development /usr/local/php/etc/php.ini
cd /usr/local/php/etc/
cp php-fpm.conf.default php-fpm.conf
cd /usr/local/src/php-5.6./sapi/fpm/
cp init.d.php-fpm /etc/init.d/php-fpm
chmod +x /etc/init.d/php-fpm
service php-fpm start
chkconfig --add php-fpm
chkconfig php-fpm on
将配置文件中的php-fpm.conf文档复制下。
重启服务
service php-fpm restart 如果在cmake的时候没有指定为用户和用户组www,
可以在php-fpm.conf配置文件中,添加include php-fpm.d/*.conf
然后在创建php-fpm.d文件夹。在该文件夹下创建www.conf
ln -s /usr/local/php/etc/php.ini /etc/php.ini
如果不添加如下,php -v读不出来 export PATH=/usr/local/php/bin:$PATH
source /etc/profile
vi /usr/local/php/etc/php-fpm.conf
[global]
pid = /usr/local/php/var/run/php-fpm.pid
error_log = /usr/local/php/var/log/php-fpm.log
log_level = notice
安装php5.6版本
查看编译:/usr/local/php/sbin/php -i | grep configure
[www]
;listen = /tmp/php-cgi.sock listen = 127.0.0.1:
listen.backlog = -
listen.allowed_clients = 127.0.0.1
listen.owner = www
listen.group = www
listen.mode =
user = www
group = www
pm = dynamic
pm.max_children =
pm.start_servers =
pm.min_spare_servers =
pm.max_spare_servers =
request_terminate_timeout =
request_slowlog_timeout =
slowlog = var/log/slow.log
pm.status_path = /status 查看nginx,php,mysql编译的参数
nginx: /usr/local/nginx/sbin/nginx -v
php: /usr/local/php/bin/php -i | grep configure
mysql: /usr/local/mysql/bin/mysqlbug | grep configure
ps -ef | grep mysql
测试篇
cat /usr/local/nginx/conf/vhost/test.conf
server {
listen ;
server_name www.test.com; location / {
root html;
index index.php index.html index.htm ;
} error_page /50x.html;
location = /50x.html {
root html;
} location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
} cd /usr/local/nginx/html
cat test.php <?php
phpinfo();
?> chown www.www /usr/local/nginx/html/ -R
chmod /usr/local/nginx/html/ -R
在浏览器中输入服务器IP/test.php地址,会看到php界面
到此,LNMP环境部署完成!
nginx1.10.3+php5.6+mysql5.7.0的更多相关文章
- 安装zabbix-3.0.3+nginx-1.10.1+php-5.6.22
好久没有接触监控类的软件了,今天抽空搭建了下最新的版本 首先系统环境 zabbix-server-1 192.168.11.11 centos6.7 mysql-server 192.168 ...
- nginx-1.10.3 编译安装
1.系统环境 [root@crazy-acong ~]# cat /etc/redhat-release CentOS release 6.6 (Final) [root@crazy-acong ~] ...
- CentOS 7.x编译安装Nginx1.10.3+MySQL5.7.16+PHP5.2 5.3 5.4 5.5 5.6 7.0 7.1多版本全能环境
准备篇 一.防火墙配置 CentOS 7.x默认使用的是firewall作为防火墙,这里改为iptables防火墙. 1.关闭firewall: systemctl stop firewalld.se ...
- CentOS 7.2.1511编译安装Nginx1.10.1+MySQL5.7.14+PHP7.0.11
准备篇 一.防火墙配置 CentOS 7.x默认使用的是firewall作为防火墙,这里改为iptables防火墙. 1.关闭firewall: systemctl stop firewalld.se ...
- CentOS 7.2.1511编译安装Nginx1.10.1+MySQL5.6.33+PHP5.6.26
准备篇 一.防火墙配置 CentOS 7.x默认使用的是firewall作为防火墙,这里改为iptables防火墙. 1.关闭firewall: systemctl stop firewalld.se ...
- CentOS 7.2mini版本下编译安装php7.0.10+MySQL5.7.14+Nginx1.10
一.安装前的准备工作 1.yum update #更新系统 2.yum install gcc gcc-c++ autoconf automake cmake bison m4 libxml2 ...
- CentOS 7.2编译安装nginx1.10.3+MySQL5.5.38+PHP5.5.38
1.关闭firewallad 关闭防火墙 systemctl stop firewalld.service 禁止firewall开机启动 systemctl disable firewalld.ser ...
- CentOS 7.2mini版本下编译安装php7.0.10+MySQL5.7.14+Nginx1.10.1
一.安装前的准备工作 1.yum update #更新系统 1.1)vi /etc/selinux/config # 禁止SELINUX,设置SELINUX=disabled 2.yum in ...
- CentOS 7.2下编译安装PHP7.0.10+MySQL5.7.14+Nginx1.10.1
一.安装前的准备工作 1.yum update #更新系统 2.yum install gcc gcc-c++ autoconf automake cmake bison m4 libxml2 ...
随机推荐
- vue 父子组件相互传值
子传父 逻辑: 单击子组件的按钮 ,触发它的单击事件 通过 $emit 触发父级自定义事件 并传一个值给父级 <div id="id"> <h3>儿子 ...
- 利用nginx使ftp可以通过http访问
./nginx 启动服务./nginx -s stop 关闭服务./nginx -s reload 重新加载配置文件 搭建nginx映射ftp服务:打开nginx的配置文件nginx.conf(位于n ...
- python 排列组合
笛卡尔积(product): 假设集合A={a, b},集合B={0, 1, 2},则两个集合的笛卡尔积为{(a, 0), (a, 1), (a, 2), (b, 0), (b, 1), (b, 2) ...
- 第三章 最简单的C程序设计——顺序程序设计
一.数据的表现形式及其运算 1.常量和变量 在计算机高级语言中,数据有两种表现形式:常量和变量. 1.1.常量 在程序运行过程中,其值不能被改变的量称为常量.如:5,6,32,0.111. 数值常量就 ...
- 洛谷U32670 小凯的数字(比赛)
题目网址 https://www.luogu.org/problemnew/show/U32670 题目背景 NOIP2018 原创模拟题T1 NOIP DAY1 T1 or DAY 2 T1 难度 ...
- Go语言中的HTTP
Go中的http使用 package main import ( "fmt" "net/http" "io/ioutil" "st ...
- c/c++ 数组传参
在c/c++中,在进行数组传参时,数组的元素个数默认是不作为实参传入调用函数,也就是说c/c++ 不允许向函数传递一个完整的数组作为参数 实例: 1.形式参数是一个指针,实参包括数组长度: 1 voi ...
- Mysql数据库的压力
rationalError: (2006, 'MySQL server has gone away') 2017年10月10日 20:04:43 阅读数:377 问题描述 使用django+celer ...
- iOS下原生与JS交互(总结)
iOS开发免不了要与UIWebView打交道,然后就要涉及到JS与原生OC交互,今天总结一下JS与原生OC交互的两种方式. JS调用原生OC篇(我自己用的方式二,简单方便) 方式一 第一种方式是用JS ...
- 「赛后补题」HBCPC2018题目代码与思路简析
这次比赛(2018年第二届河北省大学生程序设计竞赛)虽然没有打,但是题目还是要写的.未完成的题目(还差比较硬核的四题)和思路分析会陆续更新完. Problem A 2011 Mex Query /* ...