CentOS6.5 _ 64 bit compiler installation MySQL-5.6.23, centos6.5mysql

Source: Internet
Author: User

CentOS6.5 _ 64 bit compiler installation MySQL-5.6.23, centos6.5mysql

Reprinted please indicate the source: http://blog.csdn.net/guoyjoe/article/details/44785511

**************************************** ********************
CentOS6.5 _ 64bit compile and install MySQL-5.6.23
**************************************** **********************

1. Disable the Firewall
Chkconfig iptables off
Service iptables stop


2. Download The mysqlsource code package and mysql-5.6.23.tar.gz
Do not select other linux installation packages when downloading. Otherwise, an error is returned. Select Source Code, Select Platform: Source Code,
Download the Generic Linux (Architecture Independent) and Compressed TAR Archive.


3. Add users and groups:
Groupadd mysql # Add User Groups
Useradd-g mysql-s/usr/sbin/nologin


4. Create a directory and grant permissions
Mkdir-p/u01/my3306/data # mysql data DIRECTORY
Mkdir-p/u01/my3306/log/iblog # mysql innodb log
Mkdir-p/u01/my3306/log/binlog # mysql log
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


5. Decompress
Tar-zxvf mysql-5.6.23.tar.gz
Cd mysql-5.6.23


6. 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


7. Modify the parameters of the configuration file my. cnf
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_connection= 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 = 20 M
Innodb_buffer_pool_instances = 8
Innodb_change_buffering = inserts
Innodb_data_file_path = ibdata1: 32 M; ibdata2: 16 M: autoextend
Innodb_flush_method = O_DIRECT
Innodb_log_files_in_group = 4
Innodb_log_file_size = 32 M
Innodb_flush_log_at_trx_commit = 1
Innodb_file_per_table = 1
Innodb_buffer_pool_size = 128 M
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 = 64 M
Innodb_lru_scan_depth = 2048
Innodb_max_dirty_pages_pct = 60
Innodb_old_blocks_time = 1000
Innodb_online_alter_log_max_size = 200 M
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 = 2 M
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/


8. Execute the MySQL installation script
./Scripts/mysql_install_db -- defaults-file =/u01/my3306/my. cnf -- user = mysql -- datadir =/u01/my3306/data

Defaults-file indicates to specify the default configuration file. If this parameter is not specified, the default priority of the system is to use/etc/my first. cnf is used as the mysql configuration file, and those parameters of make are set in whitelist.


9. Start mysql
Mysqld_safe -- defaults-file =/u01/app/mysql/data/mysql3306/my. cnf -- user = mysql &


10. log on to MySQL
Mysql-h127.0.0.1-uroot-P3306


Related Article

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.