Centos6.5_64bit under compile and install MySQL-5.6.23

Source: Internet
Author: User

Reprint Please specify source: http://blog.csdn.net/guoyjoe/article/details/44785511

************************************************************
Centos6.5_64bit under compile and install MySQL-5.6.23
**************************************************************

First, close the firewall
Chkconfig iptables off
Service Iptables Stop


Download MySQL source package, mysql-5.6.23.tar.gz
Please do not choose to download the other Linux installation package, otherwise the compilation will definitely error. Select the Platform drop-down list to select Source code,select platform:source Code,
Download Generic Linux (Architecture independent), compressed TAR Archive.


Third, add users and groups:
Groupadd MySQL#增加用户组
useradd-g MySQL mysql-s/usr/sbin/nologin


Iv. Creating catalogs and authorizations
Mkdir-p/u01/my3306/data#mysql数据目录
Mkdir-p/u01/my3306/log/iblog #mysql InnoDB Log
Mkdir-p/u01/my3306/log/binlog #mysql日志
Mkdir-p/u01/my3306/log/relaylog
Mkdir-p/u01/my3306/run
Mkdir-p/u01/my3306/tmp
Chown-r mysql:mysql/u01/my3306
Chmod-r 755/u01/my3306


Five, decompression
TAR-ZXVF mysql-5.6.23.tar.gz
CD mysql-5.6.23


VI. Compile and install
CMake \
-dcmake_install_prefix=/u01/my3306 \
-dinstall_datadir=/u01/my3306/data \
-ddefault_charset=utf8 \
-DDEFAULT_COLLATION=UTF8_GENERAL_CI \
-dextra_charsets=all \
-dwith_ssl=yes \
-dwith_embedded_server=1 \
-denabled_local_infile=1 \
-dwith_myisam_storage_engine=1 \
-dwith_innobase_storage_engine=1 \
-dwith_archive_storage_engine=1 \
-dwith_blackhole_storage_engine=1 \
-dwith_federated_storage_engine=1 \
-dwith_partition_storage_engine=1 \
-dmysql_tcp_port=3306 \
-denabled_local_infile=1 \
-DSYSCONFDIR=/ETC \
-dwith_readline=on


Make
Make install


Vii. modifying configuration file my.cnf parameters
Cp/u01/my3306/support-files/my-default.cnf/u01/my3306/my.cnf

VI/U01/MY3306/MY.CNF---Add


[Client]
Port = 3306
Socket =/u01/my3306/run/mysql.sock

[MySQL]
No-auto-rehash
Pid_file=/u01/my3306/run/mysqld.pid

[Mysqld]
# # Disable Autocommit
Autocommit=0
General_log=off
Explicit_defaults_for_timestamp=true

# system
basedir=/u01/my3306
datadir=/u01/my3306/data/
max_allowed_packet=134217728
max_connections=8192
max_user_connections=8000
open_files_limit=65535
Pid_file=/u01/my3306/run/mysqld.pid
port=3306
Server_id=1
Skip_name_resolve=on
Socket=/u01/my3306/run/mysql.sock
Tmpdir=/u01/my3306/tmp

# Binlog
binlog_cache_size=32768
Binlog_format=row
Expire_logs_days=7
Log_bin=/u01/my3306/log/binlog
Log_slave_updates=on
max_binlog_cache_size=2147483648
max_binlog_size=524288000
sync_binlog=100

#relay
Relay_log=/u01/my3306/log/relaylog
Relay_log_index=/u01/my3306/log/relay.index
Relay_log_info_file=/u01/my3306/log/relay-log.info

# LOGGING #
Log_error =/u01/my3306/log/alert.log
Log_queries_not_using_indexes = 1
Slow_query_log = 1
Slow_query_log_file =/u01/my3306/log/slow.log
Log_slave_updates=on
Log_slow_admin_statements=1
Long_query_time=1

#slave #
Slave_skip_errors=off
Log_slave_updates=on

# InnoDB #
Innodb_log_group_home_dir=/u01/my3306/log/iblog
Innodb_data_home_dir=/u01/my3306/log/iblog
Innodb_adaptive_flushing=1
innodb_additional_mem_pool_size=20m
Innodb_buffer_pool_instances=8
Innodb_change_buffering=inserts
Innodb_data_file_path=ibdata1:32m;ibdata2:16m:autoextend
Innodb_flush_method = O_direct
Innodb_log_files_in_group = 4
Innodb_log_file_size = 32M
Innodb_flush_log_at_trx_commit = 1
innodb_file_per_table = 1
Innodb_buffer_pool_size = 128M
Innodb_file_format=barracuda
Innodb_file_io_threads=4
Innodb_flush_neighbors=0
innodb_io_capacity=200
Innodb_lock_wait_timeout=5
innodb_log_buffer_size=64m
innodb_lru_scan_depth=2048
Innodb_max_dirty_pages_pct=60
innodb_old_blocks_time=1000
innodb_online_alter_log_max_size=200m
innodb_open_files=200
Innodb_print_all_deadlocks=1
Innodb_purge_threads=4
Innodb_read_ahead_threshold=0
Innodb_read_io_threads=8
Innodb_rollback_on_timeout=0
Innodb_sort_buffer_size=2m
Innodb_spin_wait_delay=6
Innodb_stats_on_metadata=0
Innodb_strict_mode=1
innodb_sync_array_size=256
Innodb_sync_spin_loops=30
Innodb_thread_concurrency=64
Innodb_use_native_aio=0
Innodb_write_io_threads=8
Innodb_support_xa=1

[Mysqld_safe]
datadir=/u01/my3306/data/


Viii. Execute MySQL installation script
./scripts/mysql_install_db--defaults-file=/u01/my3306/my.cnf--user=mysql--datadir=/u01/my3306/data

Description: Defaults-file indicates that the default configuration file is specified, and if not specified, the default priority is to use/ETC/MY.CNF as the MySQL configuration file before the parameters of make are set to white.


Nine, start MySQL
Mysqld_safe--defaults-file=/u01/app/mysql/data/mysql3306/my.cnf--user=mysql &


Ten, login MySQL
mysql-h127.0.0.1-uroot-p3306


Centos6.5_64bit under compile and install MySQL-5.6.23

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.