centos 7 MysSQL 5.7.23 源码安装
MySQL 5.7.23 源码安装
CentOS 7 将默认数据库
MySQL
替换成了Mariadb
。
这里会从系统的环境准备开始一步一步安装。
环境准备
系统版本 | 内核版本 | IP地址 |
---|---|---|
Centos 7.5 | 4.18.9-1.el7.elrepo.x86_64 | 10.0.0.3 |
备注 该系统采用MINI
最小化安装,安装之后对系统进行了最基础的优化操作,操作过程点击这里
删除系统自带的依赖包
[root@node soft]# rpm -qa | egrep 'mysql|mariadb'
mariadb-libs-5.5.56-2.el7.x86_64
[root@node soft]# rpm -qa | egrep 'mysql|mariadb' | xargs rpm -e --nodeps
[root@node soft]# rpm -qa | egrep 'mysql|mariadb'
[root@node soft]#
创建MySQL运行用户
[root@node soft]# useradd -s /sbin/nologin -M mysql
[root@node soft]# grep mysql /etc/passwd
mysql:x:1000:1000::/home/mysql:/sbin/nologin
下载 MySQL
可以在mirrors.163.com
的163源下载
下载地址
如果上面的下载地址失效了,则可以使用百度网盘链接:https://pan.baidu.com/s/1hV30Sw2VY0PKgakVQcLoMw
提取码:qcao
[root@node soft]# wget http://mirrors.163.com/mysql/Downloads/MySQL-5.7/mysql-5.7.23.tar.gz
--2018-10-08 11:03:26-- http://mirrors.163.com/mysql/Downloads/MySQL-5.7/mysql-5.7.23.tar.gz
Resolving mirrors.163.com (mirrors.163.com)... 59.111.0.251
Connecting to mirrors.163.com (mirrors.163.com)|59.111.0.251|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 51907462 (50M) [application/octet-stream]
Saving to: ‘mysql-5.7.23.tar.gz’
100%[===================================================================================================================================================>] 51,907,462 1.67MB/s in 30s
2018-10-08 11:03:56 (1.65 MB/s) - ‘mysql-5.7.23.tar.gz’ saved [51907462/51907462]
[root@node soft]# ls
mysql-5.7.23.tar.gz
# 解压
[root@node soft]# tar xf mysql-5.7.23.tar.gz
[root@node soft]# ls
mysql-5.7.23 mysql-5.7.23.tar.gz
编译安装
首先准备编译环境
使用yum下载编译工具和其他依赖包
[root@node soft]# yum install cmake bison git ncurses-devel gcc gcc-c++ -y
使用cmake编译工具对mysql进行编译
[root@node soft]# cd mysql-5.7.23
[root@node mysql-5.7.23]# pwd
/opt/soft/mysql-5.7.23
[root@node mysql-5.7.23]# ls
BUILD CMakeLists.txt configure.cmake Docs include libbinlogstandalone libmysqld mysql-test packaging README sql strings unittest win
client cmd-line-utils COPYING Doxyfile-perfschema INSTALL libevent libservices mysys plugin regex sql-common support-files VERSION zlib
cmake config.h.cmake dbug extra libbinlogevents libmysql man mysys_ssl rapid scripts storage testclients vio
[root@node mysql-5.7.23]# cmake . \
-DCMAKE_INSTALL_PREFIX=/opt/mysql-5.7.23 \
-DMYSQL_DATADIR=/opt/mysql-5.7.23/data \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DMYSQL_USER=mysql \
-DWITH_BOOST=/opt/soft/boost_1_59_0 \
-DWITH_EMBEDDED_SERVER=OFF
-- Running cmake version 2.8.12.2
-- Configuring with MAX_INDEXES = 64U
-- CMAKE_GENERATOR: Unix Makefiles
-- SIZEOF_VOIDP 8
-- MySQL 5.7.23
-- Packaging as: mysql-5.7.23-Linux-x86_64
-- Downloading boost_1_59_0.tar.gz to /usr/local/boost
-- [download 100% complete]
-- [download 98% complete]
-- [download 100% complete]
-- [download 97% complete]
-- [download 100% complete]
-- [download 0% complete]
-- [download 1% complete]
-- [download 2% complete]
-- [download 3% complete]
-- [download 4% complete]
............................
# 一直到百分之百完成
-- Googletest was not found. gtest-based unit tests will be disabled. You can run cmake . -DENABLE_DOWNLOADS=1 to automatically download and build required components from source.
-- If you are inside a firewall, you may need to use an https proxy: export https_proxy=http://example.com:80
-- Performing Test HAVE_MISLEADING_INDENTATION
-- Performing Test HAVE_MISLEADING_INDENTATION - Failed
-- executable target mysqld debug_target /opt/soft/debug/sql/mysqld
-- INSTALL mysqlclient.pc lib/pkgconfig
-- Skipping deb packaging on unsupported platform .
-- CMAKE_BUILD_TYPE: RelWithDebInfo
-- COMPILE_DEFINITIONS: _GNU_SOURCE;_FILE_OFFSET_BITS=64;HAVE_CONFIG_H;HAVE_LIBEVENT1
-- CMAKE_C_FLAGS: -Wall -Wextra -Wformat-security -Wvla -Wwrite-strings -Wdeclaration-after-statement
-- CMAKE_CXX_FLAGS: -Wall -Wextra -Wformat-security -Wvla -Woverloaded-virtual -Wno-unused-parameter
-- CMAKE_C_LINK_FLAGS:
-- CMAKE_CXX_LINK_FLAGS:
-- CMAKE_C_FLAGS_RELWITHDEBINFO: -O3 -g -fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing -DDBUG_OFF
-- CMAKE_CXX_FLAGS_RELWITHDEBINFO: -O3 -g -fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing -DDBUG_OFF
-- Configuring done
-- Generating done
-- Build files have been written to: /opt/soft/mysql-5.7.23
[root@node mysql-5.7.23]#
注:
DCMAKE_INSTALL_PREFIX=/usr/local/mysql:安装路径
DMYSQL_DATADIR=/data/mysql:数据文件存放位置
DSYSCONFDIR=/etc:my.cnf路径
DWITH_MYISAM_STORAGE_ENGINE=1:支持MyIASM引擎
DWITH_INNOBASE_STORAGE_ENGINE=1:支持InnoDB引擎
DMYSQL_UNIX_ADDR=/data/mysql/mysqld.sock:连接数据库socket路径
DMYSQL_TCP_PORT=3306:端口
DENABLED_LOCAL_INFILE=1:允许从本地导入数据
DWITH_PARTITION_STORAGE_ENGINE=1:安装支持数据库分区
DEXTRA_CHARSETS=all:安装所有的字符集
DDEFAULT_CHARSET=utf8:默认字符
DWITH_EMBEDDED_SERVER=1:嵌入式服务器
configuration完成之后,下面开始编辑安装
[root@node mysql-5.7.23]# make && make install
Scanning dependencies of target INFO_BIN
[ 0%] Built target INFO_BIN
Scanning dependencies of target INFO_SRC
[ 0%] Built target INFO_SRC
Scanning dependencies of target abi_check
[ 0%] Built target abi_check
Scanning dependencies of target zlib
[ 0%] Building C object zlib/CMakeFiles/zlib.dir/adler32.c.o
[ 0%] Building C object zlib/CMakeFiles/zlib.dir/compress.c.o
[ 0%] Building C object zlib/CMakeFiles/zlib.dir/crc32.c.o
[ 0%] Building C object zlib/CMakeFiles/zlib.dir/deflate.c.o
[ 0%] Building C object zlib/CMakeFiles/zlib.dir/gzio.c.o
[ 0%] Building C object zlib/CMakeFiles/zlib.dir/infback.c.o
[ 0%] Building C object zlib/CMakeFiles/zlib.dir/inffast.c.o
[ 0%] Building C object zlib/CMakeFiles/zlib.dir/inflate.c.o
[ 0%] Building C object zlib/CMakeFiles/zlib.dir/inftrees.c.o
[ 0%] Building C object zlib/CMakeFiles/zlib.dir/trees.c.o
[ 0%] Building C object zlib/CMakeFiles/zlib.dir/uncompr.c.o
[ 0%] Building C object zlib/CMakeFiles/zlib.dir/zutil.c.o
Linking C static library ../archive_output_directory/libzlib.a
[ 0%] Built target zlib
Scanning dependencies of target yassl
[ 0%] Building CXX object extra/yassl/CMakeFiles/yassl.dir/src/buffer.cpp.o
[ 0%] Building CXX object extra/yassl/CMakeFiles/yassl.dir/src/cert_wrapper.cpp.o
[ 0%] Building CXX object extra/yassl/CMakeFiles/
.............................
# 这里也是到百分之百后不报错,就结束啦。
-- Installing: /opt/mysql-5.7.23/mysql-test/./t/xa_prepared_binlog_off-master.opt
-- Installing: /opt/mysql-5.7.23/mysql-test/./t/xa_prepared_binlog_off.test
-- Installing: /opt/mysql-5.7.23/mysql-test/./t/xml.test
-- Installing: /opt/mysql-5.7.23/mysql-test/./valgrind.supp
-- Installing: /opt/mysql-5.7.23/mysql-test/./mtr
-- Installing: /opt/mysql-5.7.23/mysql-test/./mysql-test-run
-- Installing: /opt/mysql-5.7.23/mysql-test/./Makefile
-- Installing: /opt/mysql-5.7.23/mysql-test/./cmake_install.cmake
-- Installing: /opt/mysql-5.7.23/mysql-test/./CTestTestfile.cmake
-- Installing: /opt/mysql-5.7.23/./COPYING-test
-- Installing: /opt/mysql-5.7.23/./README-test
-- Up-to-date: /opt/mysql-5.7.23/mysql-test/mtr
-- Up-to-date: /opt/mysql-5.7.23/mysql-test/mysql-test-run
-- Installing: /opt/mysql-5.7.23/mysql-test/lib/My/SafeProcess/my_safe_process
-- Up-to-date: /opt/mysql-5.7.23/mysql-test/lib/My/SafeProcess/my_safe_process
-- Installing: /opt/mysql-5.7.23/mysql-test/lib/My/SafeProcess/Base.pm
-- Installing: /opt/mysql-5.7.23/support-files/mysqld_multi.server
-- Installing: /opt/mysql-5.7.23/support-files/mysql-log-rotate
-- Installing: /opt/mysql-5.7.23/support-files/magic
-- Installing: /opt/mysql-5.7.23/share/aclocal/mysql.m4
-- Installing: /opt/mysql-5.7.23/support-files/mysql.server
[root@node mysql-5.7.23]# cd /opt/
[root@node opt]# ls
mysql-5.7.23 soft
[root@node opt]# cd mysql-5.7.23/
[root@node mysql-5.7.23]# ls
bin COPYING COPYING-test docs include lib man mysql-test README README-test share support-files usr
提示:
编译安装过程中,会有一些警告信息,可以忽略,只要不是error错误信息导致编译失败,就没啥问题。
配置环境变量
[root@node soft]# cd /opt/
[root@node opt]# ls
mysql-5.7.23 soft
[root@node opt]# chown -R mysql.mysql mysql-5.7.23
[root@node opt]# ll
total 0
drwxr-xr-x 9 mysql mysql 129 Sep 30 10:33 mysql-5.7.23
drwxr-xr-x 2 root root 56 Sep 30 10:34 soft
[root@node opt]# echo 'export PATH=$PATH:/opt/mysql-5.7.23/bin' >> /etc/profile
[root@node opt]# tail -1 /etc/profile
export PATH=$PATH:/opt/mysql-5.7.23/bin
[root@node opt]# source /etc/profile
[root@node opt]# mysql -V
mysql Ver 14.14 Distrib 5.7.23, for Linux (x86_64) using EditLine wrapper wrapper
配置文件
[root@node mysql-5.7.23]# cat my.cnf
[client]
socket = /tmp/mysql.sock
port=3306
[mysql]
default-character-set=utf8
[mysqld]
basedir=/opt/mysql-5.7.23
datadir=/opt/mysql-5.7.23/data
port=3306
pid-file=/opt/mysql-5.7.23/mysqld.pid
skip-name-resolve
socket = /tmp/mysql.sock
character-set-server=utf8
default-storage-engine=INNODB
explicit_defaults_for_timestamp = true
server-id=1
max_connections=2000
query_cache_size=0
table_open_cache=2000
tmp_table_size=246M
thread_cache_size=300
thread_stack = 192k
key_buffer_size=512M
read_buffer_size=4M
read_rnd_buffer_size=32M
innodb_data_home_dir = /opt/mysql-5.7.23/data
innodb_flush_log_at_trx_commit=0
innodb_log_buffer_size=16M
innodb_buffer_pool_size=256M
innodb_log_file_size=128M
innodb_thread_concurrency=128
innodb_autoextend_increment=1000
innodb_buffer_pool_instances=8
innodb_concurrency_tickets=5000
innodb_old_blocks_time=1000
innodb_open_files=300
innodb_stats_on_metadata=0
innodb_file_per_table=1
innodb_checksum_algorithm=0
back_log = 80
flush_time = 0
join_buffer_size = 128M
max_allowed_packet = 1024M
max_connect_errors = 2000
open_files_limit = 4161
query_cache_type = 0
sort_buffer_size = 32M
table_definition_cache = 1400
binlog_row_event_max_size = 8K
sync_master_info = 10000
sync_relay_log = 10000
sync_relay_log_info = 10000
bulk_insert_buffer_size = 64M
interactive_timeout = 120
wait_timeout = 120
log-bin-trust-function-creators=1
sql_mode = NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
[mysqld_safe]
log-error = /opt/mysql-5.7.23/error.log
pid-file = /opt/mysql-5.7.23/mysqld.pid
初始化 MySQL
[root@node mysql-5.7.23]# pwd
/opt/mysql-5.7.23
[root@node mysql-5.7.23]# mkdir data
[root@node mysql-5.7.23]# ./bin/mysqld --initialize --user=mysql --basedir=/opt/mysql-5.7.23 --datadir=/opt/mysql-5.7.23/data
2018-10-08T09:04:28.128022Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-10-08T09:04:28.359490Z 0 [Warning] InnoDB: New log files created, LSN=45790
2018-10-08T09:04:28.386577Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2018-10-08T09:04:28.445495Z 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: 294d6e77-cad9-11e8-8795-000c2916c9b7.
2018-10-08T09:04:28.447604Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2018-10-08T09:04:28.449979Z 1 [Note] A temporary password is generated for root@localhost: %,K()<Y)p1W!
配置启动脚本并开机自启
[root@node mysql-5.7.23]# cp support-files/mysql.server /etc/init.d/mysqld
[root@node mysql-5.7.23]# chmod +x /etc/init.d/mysqld
[root@node mysql-5.7.23]# chkconfig --add mysqld
[root@node mysql-5.7.23]# chkconfig mysqld on
[root@node mysql-5.7.23]# chkconfig | grep mysql
Note: This output shows SysV services only and does not include native
systemd services. SysV configuration data might be overridden by native
systemd configuration.
If you want to list systemd services use 'systemctl list-unit-files'.
To see services enabled on particular target use
'systemctl list-dependencies [target]'.
mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off
[root@node mysql-5.7.23]# /etc/init.d/mysqld start
Starting MySQL.. SUCCESS!
[root@node mysql-5.7.23]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.23 Source distribution
Copyright (c) 2000, 2018, 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> \q
Bye
查看日志
[root@node mysql-5.7.23]# cat error.log
2018-10-08T09:06:22.978084Z 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.
2018-10-08T09:06:22.978123Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set.
2018-10-08T09:06:22.978145Z 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled
2018-10-08T09:06:22.978165Z 0 [Note] /opt/mysql-5.7.23/bin/mysqld (mysqld 5.7.23) starting as process 85884 ...
2018-10-08T09:06:23.012316Z 0 [Note] InnoDB: PUNCH HOLE support available
2018-10-08T09:06:23.012531Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-10-08T09:06:23.012541Z 0 [Note] InnoDB: Uses event mutexes
2018-10-08T09:06:23.012544Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2018-10-08T09:06:23.012547Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2018-10-08T09:06:23.012567Z 0 [Note] InnoDB: Adjusting innodb_buffer_pool_instances from 8 to 1 since innodb_buffer_pool_size is less than 1024 MiB
2018-10-08T09:06:23.013278Z 0 [Note] InnoDB: Number of pools: 1
2018-10-08T09:06:23.013357Z 0 [Note] InnoDB: Using CPU crc32 instructions
2018-10-08T09:06:23.014423Z 0 [Note] InnoDB: Initializing buffer pool, total size = 256M, instances = 1, chunk size = 128M
2018-10-08T09:06:23.027048Z 0 [Note] InnoDB: Completed initialization of buffer pool
2018-10-08T09:06:23.029941Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2018-10-08T09:06:23.042131Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2018-10-08T09:06:23.048764Z 0 [Warning] InnoDB: Resizing redo log from 2*3072 to 2*8192 pages, LSN=2588953
2018-10-08T09:06:23.152042Z 0 [Warning] InnoDB: Starting to delete and rewrite log files.
2018-10-08T09:06:23.183822Z 0 [Note] InnoDB: Setting log file ./ib_logfile101 size to 128 MB
2018-10-08T09:06:23.183932Z 0 [Note] InnoDB: Progress in MB:
100
2018-10-08T09:06:23.322038Z 0 [Note] InnoDB: Setting log file ./ib_logfile1 size to 128 MB
2018-10-08T09:06:23.322150Z 0 [Note] InnoDB: Progress in MB:
100
2018-10-08T09:06:23.462641Z 0 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2018-10-08T09:06:23.462689Z 0 [Warning] InnoDB: New log files created, LSN=2588953
2018-10-08T09:06:23.462962Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2018-10-08T09:06:23.463003Z 0 [Note] InnoDB: Setting file '/opt/mysql-5.7.23/data/ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2018-10-08T09:06:23.475948Z 0 [Note] InnoDB: File '/opt/mysql-5.7.23/data/ibtmp1' size is now 12 MB.
2018-10-08T09:06:23.476603Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2018-10-08T09:06:23.476611Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2018-10-08T09:06:23.476865Z 0 [Note] InnoDB: Waiting for purge to start
2018-10-08T09:06:23.527970Z 0 [Note] InnoDB: 5.7.23 started; log sequence number 2588944
2018-10-08T09:06:23.528861Z 0 [Note] Plugin 'FEDERATED' is disabled.
2018-10-08T09:06:23.546917Z 0 [Note] InnoDB: Loading buffer pool(s) from /opt/mysql-5.7.23/data/ib_buffer_pool
2018-10-08T09:06:23.551708Z 0 [Note] InnoDB: Buffer pool(s) load completed at 181008 17:06:23
2018-10-08T09:06:23.552223Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
2018-10-08T09:06:23.552261Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
2018-10-08T09:06:23.552568Z 0 [Note] IPv6 is available.
2018-10-08T09:06:23.552770Z 0 [Note] - '::' resolves to '::';
2018-10-08T09:06:23.553044Z 0 [Note] Server socket created on IP: '::'.
2018-10-08T09:06:23.581116Z 0 [Note] /opt/mysql-5.7.23/bin/mysqld: ready for connections.
Version: '5.7.23' socket: '/tmp/mysql.sock' port: 3306 Source distribution
centos 7 MysSQL 5.7.23 源码安装的更多相关文章
- centos 7 MysSQL 5.6.39 源码安装
MySQL 5.6.39 二进制安装 CentOS 7 将默认数据库MySQL替换成了Mariadb. 这里会从系统的环境准备开始一步一步安装. 环境准备 系统版本 内核版本 IP地址 Centos ...
- CentOS 6.5 MySQL5.6.26源码安装
一.源码安装cmake工具 从mysql5.5起,mysql源码安装开始使用cmake wget http://cmake.org/files/v3.2/cmake-3.2.3.tar.gztar z ...
- Linux(CentOS或RadHat)下MySQL源码安装
安装环境: CentOS6.3 64位 软件: Mysql-5.6 所需包: gcc/g++ :MySQL 5.6开始,需要使用g++进行编译.cmake :MySQL 5.5开始,使用cmake进 ...
- CentOS 6.9/Ubuntu 16.04源码安装RabbitMQ(二进制包tar.gz)
说明:CentOS的安装方式同样适合在Ubuntu中,把源改成APT即可. 一.安装erlang: 下载erlang: 从Erlang的官网http://www.erlang.org/download ...
- Greenplum 源码安装教程 —— 以 CentOS 平台为例
Greenplum 源码安装教程 作者:Arthur_Qin 禾众 Greenplum 主体以及orca ( 新一代优化器 ) 的代码以可以从 Github 上下载.如果不打算查看代码,想下载编译好的 ...
- CentOS 7下源码安装MySQL 5.7
网上说linux安装mysql服务分两种安装方法: ①源码安装,优点是安装包比较小,只有几十M左右,缺点是安装依赖的库多,安装编译时间长,安装步骤复杂容易出错: ②使用官方编译好的二进制文件安装,优点 ...
- centos 6x系统下源码安装mysql操作记录
在运维工作中经常部署各种运维环境,涉及mysql数据库的安装也是时常需要的.mysql数据库安装可以选择yum在线安装,但是这种安装的mysql一般是系统自带的,版本方面可能跟需求不太匹配.可以通过源 ...
- CentOS 7下源码安装MySQL 5.6
本文转载,并非原创. 目录 准备工作 运行环境 确认你的安装版本 下载MySQL 安装MySQL 准备安装环境 编译和安装 配置MySQL 单实例配置 单实例配置方法 添加防火墙 启动MySQL 重启 ...
- CentOS 6.5下源码安装MySQL 5.6
变量lower_case_file_system说明是否数据目录所在的文件系统对文件名的大小写敏感.ON说明对文件名的大小写不敏感,OFF表示敏感. 在my.cnf中[mysqld]更改lower_c ...
随机推荐
- SpringBoot整合Redis在可视化工具乱码问题,以及常用的api
pom依赖: <parent> <groupId>org.springframework.boot</groupId> <artifactId>spr ...
- NOIP模拟 23
曾经有一段真挚的AK摆在skyh面前,但他一直意淫自己AK导致没有AK. 如果非要把这AK加一个期限的话,skyh一辈子都AK不了了. 论爆零选手的爆零原因 我说T3想到了能AC的思路但是爆零了有人同 ...
- spring session源码解析
模块划分 core部分代码 存储实现部分部分: jdbc实现 具体存储的实现类 例如:org.springframework.session.jdbc.JdbcOperationsSessionRep ...
- 关于GC(上):Apache的POI组件导致线上频繁FullGC问题排查及处理全过程
某线上应用在进行查询结果导出Excel时,大概率出现持续的FullGC.解决这个问题时,记录了一下整个的流程,也可以作为一般性的FullGC问题排查指导. 1. 生成dump文件 为了定位FullGC ...
- LeetCode刷题总结-数组篇(番外)
本期共7道题,三道简单题,四道中等题. 此部分题目是作者认为有价值去做的一些题,但是其考察的知识点不在前三篇总结系列里面. 例1解法:采用数组索引位置排序的思想. 例2解法:考察了组合数学的组合公式应 ...
- P3521 [POI2011]ROT-Tree Rotations(线段树合并)
一句话题意(不用我改了.....):给一棵n(1≤n≤200000个叶子的二叉树,可以交换每个点的左右子树,要求前序遍历叶子的逆序对最少. ......这题输入很神烦呐... 给你一棵二叉树的dfs序 ...
- PHP array_multisort实现二维数组排序
PHP array_multisort实现二维数组排序 参数中的数组被当成一个表的列并以行来进行排序 - 这类似 SQL 的 ORDER BY 子句的功能.第一个数组是要排序的主要数组.数组中的行(值 ...
- python的基础认识
一.python的简介 python的创始人为吉多·范罗苏姆(Guido van Rossum).1989年的圣诞节期间,Guido开始写能够解释Python语言语法的解释器.Python这个名 ...
- mysql-大量数据的sql查询优化
1.应尽量避免在 where 子句中使用!=或<>操作符,否则将引擎放弃使用索引而进行全表扫描. 2.对查询进行优化,应尽量避免全表扫描,首先应考虑在 where 及 order by 涉 ...
- RabbitMQ 的高可用集群
RabbitMQ 的高可用性 RabbitMQ 是比较有代表性的,因为是基于主从(非分布式)做高可用的 RabbitMQ 有三种模式:单机模式.普通集群模式.镜像集群模式. 单机模式 单机模式,生产几 ...