percona-server-5.7.11-4原始碼安裝手冊
環境描述:
安裝軟體 |
描述 |
作業系統 |
CentOS7_x86_64 (CentOS Linux release 7.2.1511 (Core)) |
資料庫軟體 |
percona-server-5.7.11-4.tar.gz(原始碼安裝包) Percona-Server-5.7.11-4-Linux.x86_64.ssl101.tar.gz(二進位制安裝包) |
軟體下載:
依賴包安裝:
rpm -q gcc gcc-c++ ncurses-devel cmake libaio bison zlib-devel
利用Yum安裝依賴包 yum install package_name -y
[root@localhost home]# cat /etc/yum.repos.d/CentOS-Base.repo
[Base]
name=CentOS7 ISO Base
baseurl=file:///mnt/cdrom
enabled=1
gpgcheck=0
上傳並解壓安裝包:
[root@localhost soft]# cd /tools/soft/MySQL/
[root@localhost MySQL]# tar -xzvf percona-server-5.7.11-4.tar.gz
建立授權使用者:
/usr/sbin/groupadd mysql
/usr/sbin/useradd mysql -g mysql -d /home/mysql -s /sbin/nologin
mkdir /home/mysql/data
mkdir /home/mysql/log
mkdir /home/mysql/tmp
mkdir /home/mysql/binlog
mkdir /usr/local/mysql
chown -R mysql.mysql /usr/local/mysql
chown -R mysql.mysql /home/mysql
原始碼包編譯安裝:
cd /tools/soft/
tar -xzvf boost_1_59_0.tar.gz
mv boost_1_59_0 /usr/local/boost
cd percona-server-5.7.11-4
cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DMYSQL_UNIX_ADDR=/home/mysql/mysql.sock \
-DWITH_BOOST=/usr/local/boost \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITH_EDITLINE=bundled \
-DENABLED_LOCAL_INFILE=1 \
-DMYSQL_DATADIR=/home/mysql/data \
-DMYSQL_TCP_PORT=3306 \
-DZLIB_INCLUDE_DIR:PATH=/usr/include \
-DENABLE_DOWNLOADS=1
make -j 8
make install
初始化資料庫:
cd /usr/local/mysql/
./bin/mysqld --initialize-insecure --user=mysql --basedir=/usr/local/mysql --datadir=/home/mysql/data
./bin/mysql_ssl_rsa_setup --user=mysql --basedir=/usr/local/mysql --datadir=/home/mysql/data
配置資料庫:
cd /usr/local/mysql/
cp support-files/my-default.cnf /etc/my.cnf
>/etc/my.cnfvi /etc/my.cnf
[client]
socket=/home/mysql/mysql.sock
[mysqld]
symbolic-links=0
server_id = 120
default_storage_engine = Innodb
user = mysql
port = 3306
basedir = /usr/local/mysql
datadir = /home/mysql/data
tmpdir = /home/mysql/tmp
socket = /home/mysql/mysql.sock
pid_file = /home/mysql/mysql.pid
# Character Sets & Collations
character_set_server = utf8
collation_server = utf8_general_ci
open_files_limit = 10240
explicit_defaults_for_timestamp
# 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_error
log_error = /home/mysql/log/error.log
#binlog
log_bin = /home/mysql/binlog/mysql-bin
binlog_cache_size = 32M
max_binlog_cache_size = 2G
max_binlog_size = 500M
binlog_format = mixed
log_output = FILE
expire_logs_days = 5
# Slow Query Parameter
slow_query_log = 1
long_query_time = 3
slow_query_log_file = /home/mysql/log/slow-query.log
# General Log
#general_log = 0
#general_log_file = /data/mysqldata/3307/general-query.log
# Innodb Engine Parameter
#innodb_data_file_path = ibdata1:1G:autoextend
innodb_buffer_pool_size = 500M
innodb_log_file_size = 200M
innodb_log_files_in_group = 3
#innodb_flush_log_at_trx_commit = 2
innodb_lock_wait_timeout = 20
[mysql]
no_auto_rehash
[mysqld_safe]
log-error=/home/mysql/log/error.log
配置mysql系統服務:
cd /usr/local/mysql
cp support-files/mysql.server /etc/init.d/mysql
chkconfig --add mysql
chkconfig mysql on
啟動資料庫:
service mysql start
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/27067062/viewspace-2095163/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Hbase安裝手冊
- Hive安裝手冊Hive
- RAC安裝手冊
- Erlang安裝手冊-windowsWindows
- GP完整安裝手冊
- Discoverer Desktop安裝手冊
- Oracle VM Server安裝手冊OracleServer
- 求petstore的安裝手冊?
- FVWM安裝完全手冊(轉)
- ORACLE FOR SUN SOLARIS 安裝手冊Oracle
- Rational ClearCase Windows安裝手冊Windows
- PHPNuke完全安裝手冊(轉)PHP
- Go語言快速安裝手冊Go
- gitlab服務安裝手冊Gitlab
- MySql安裝及整合Hive手冊MySqlHive
- GOLDENGATE安裝和配置手冊Go
- RH9安裝手冊,很好!
- LAMP原始碼安裝+wordpress安裝LAMP原始碼
- Frida官方手冊 - 安裝Frida
- freebsd7.0安裝cacti手冊
- AIX平臺Oracle ODBC安裝手冊AIOracle
- EBS R12 安裝完全手冊
- Pycharm安裝破解 註冊碼PyCharm
- nginx原始碼安裝Nginx原始碼
- 原始碼安裝postgresql原始碼SQL
- 原始碼安裝openresty原始碼REST
- 原始碼安裝GO原始碼Go
- Nginx 原始碼安裝Nginx原始碼
- mysql原始碼安裝MySql原始碼
- zabbix原始碼安裝原始碼
- 原始碼安裝lamp原始碼LAMP
- 原始碼安裝MySQL原始碼MySql
- 原始碼安裝Nginx原始碼Nginx
- 【推薦 - 原始碼安裝】nginx - 安裝原始碼Nginx
- Cloudfoundry(v2) with Openstack(Folsom)安裝手冊Cloud
- Puppet+foreman 本地yum安裝手冊REM
- GOLDENGATE安裝和配置手冊總結Go
- Oracle10g RAC安裝手冊 (zt)Oracle