您好,登錄后才能下訂單哦!
http://dev.mysql.com/downloads/mysql/ Source Code
https://cmake.org/download/ 5.5后版本需用cmake編譯
mysql-5.7 需要
-DDOWNLOAD_BOOST=1 \
-DWITH_BOOST=/data/boost_1_59_0
yum install -y gcc gcc-c++ gcc-g77 autoconf automake zlib* fiex* libxml* ncurses-devel libmcrypt* libtool-ltdl-devel* |
CentOS7 磁盤擴容文件系統為xfs 最后LV擴容后重新識別使用xfs_growfs
tar zxvf cmake-3.4.1.tar.gz
cd cmake-3.4.1
./configure
make
make install
tar –xvfz mysql-5.6.28.tar.gz
cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_FEDERATED_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 \
-DWITH_PARITION_STORAGE_ENGINE=1 \
-DWITH_READLINE=ON \
-DEXTRA_CHARSETS=all \
-DMYSQL_DATADIR=/usr/local/mysql/data \
-DSYSCONFDIR=/data/3306 \
-DMYSQL_UNIX_ADDR=/data/3306/mysql.sock \
-DENABLED_LOCAL_INFILE=1
make && make install
groupadd mysql
useradd -r -g mysql mysql
mkdir -p /usr/local/mysql
chown -R mysql:mysql /usr/local/mysql
mkdir -p /usr/local/mysql/data
mkdir -p /data/{3306/{data,tmp,binlog},backup,scripts}
chown -R mysql:mysql /data
vi /etc/security/limits.conf
mysql soft nproc 2047
mysql hard nproc 16384
mysql soft nofile 1024
mysql hard nofile 65536
vi /data/3306/my.cnf
[client]
port = 3306
socket = /data/3306/mysql.sock
#The MYSQL SERVER
[mysqld]
port = 3306
user = mysql
server-id = 111111
socket = /data/3306/mysql.sock
pid-file = /data/3306/mysql.pid
basedir = /usr/local/mysql
datadir = /data/3306/data
tmpdir = /data/3306/tmp
open_files_limit = 10240
explicit_defaults_for_timestamp
sql_mode = NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
#BUFFER
max_allowed_packet = 256M
max_heap_table_size = 256M
net_buffer_length = 8K
sort_buffer_size = 2M
join_buffer_size = 4M
read_buffer_size = 2M
read_rnd_buffer_size = 16M
#log
log-bin = /data/3306/binlog/mysql-bin
binlog_cache_size = 32m
max_binlog_cache_size = 512m
max_binlog_size = 512m
binlog_format = mixed
log_output = FILE
log-error = ../mysql-error.log
slow_query_log = 1
slow_query_log_file = ../slow_query.log
general_log = 0
general_log_file = ../general_query.log
expire-logs-days = 14
#InnoDB
innodb_data_file_path = ibdata1:2048M:autoextend
innodb_log_file_size = 256M
innodb_log_files_in_group = 3
innodb_buffer_pool_size = 1024M
[mysql]
no-auto-rehash
prompt = (\u@\h)[\d]\_
default-character-set = utf8
/usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/data/3306/data
cp support-files/mysql.server /etc/init.d/mysql
service mysql start #若啟動不成功,查看是哪個my.cnf啟動的
./mysqld_safe --defaults-file=/data/3306/my.cnf
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。