Under the big environment MySQL5.6 source installation actual combat step by step teaches you centos6.5_64bit under compiles installs Mysql-5.6.23@guoyjoe

Source: Internet
Author: User
Tags chmod openssl openssl rsa

L Reprint Please specify Source:http://blog.csdn.net/guoyjoe/article/details/44813039

First, close the firewall


Second, check if MySQL is installed on the operating system
[[email protected] backup]# rpm-qa |grep MySQL
Qt-mysql-4.6.2-26.el6_4.x86_64
Mysql-5.1.71-1.el6.x86_64
Mysql-server-5.1.71-1.el6.x86_64
Mysql-devel-5.1.71-1.el6.x86_64
Mysql-libs-5.1.71-1.el6.x86_64


Third, delete the MYQL (redhat6.3 server comes with the mysql-libs is mysql-libs-5.1.61-4.el6.x86_64, may be in conflict with the higher version of Mysql-libs)
Yum Remove Mysql-libs


Iv. make sure the MySQL related package is completely deleted
[[email protected] backup]# rpm-qa |grep MySQL


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.


Vi. adding users and groups:

Groupadd  MySQL #增加用户组useradd-d/home/mysql-g MySQL MySQL


Seven, with the MySQL environment variable
Su-mysql
VI. bash_profile
Path= $PATH: $HOME/bin:/u01/my3306/bin
source. bash_profile


Viii. creation of catalogs and authorizations

Mkdir-p/u01/my3306/datamkdir-p/u01/my3306/log/iblogmkdir-p/u01/my3306/log/binlogmkdir-p/u01/my3306/log/ Relaylogmkdir-p/u01/my3306/runmkdir-p/u01/my3306/tmpchown-r mysql:mysql/u01/my3306chmod-r 777/u01/my3306

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


Ten, 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_unix_addr=/u01/ My3306/run/mysql.sock-dmysql_tcp_port=3306-denabled_local_infile=1-dsysconfdir=/etc-dwith_readline=onmakemake Install

Xi. parameter Configuration/u01/my3306/my.cnf

[client]port=3306socket=/u01/my3306/mysql.sock[mysql]pid_file=/u01/my3306/run/mysqld.pid[mysqld]# Disable Autocommitautocommit=0general_log=offexplicit_defaults_for_timestamp=truesha256_password_private_key_path=/u01 /my3306/mykey.pemsha256_password_public_key_path=/u01/my3306/mykey.pub# systembasedir=/u01/my3306datadir=/u01/ My3306/datamax_allowed_packet=134217728max_connections=8192max_user_connections=8000open_files_limit=65535pid_ file=/u01/my3306/run/mysqld.pidport=3306server_id=101skip_name_resolve=onsocket=/u01/my3306/run/ mysql.socktmpdir=/u01/my3306/tmp#binlog#log-bin=/u01/my3306/log/binloglog_bin=/u01/my3306/log/binlog/ Binlogbinlog_cache_size=32768binlog_format=rowexpire_logs_days=7log_slave_updates=onmax_binlog_cache_size= 2147483648max_binlog_size=524288000sync_binlog=100#logginglog_error=/u01/my3306/log/alert.logslow_query_log_ File=/u01/my3306/log/slow.loglog_queries_not_using_indexes=1slow_query_log=1log_slave_updates=onlog_slow_admin _statements=1long_query_time=1#relayrelay_log=/u01/my3306/log/relaylogrelay_log_index=/u01/my3306/log/relay.indexrelay_log_info_file=/u01/my3306/log/ relay-log.info#slaveslave_load_tmpdir=/u01/my3306/tmpslave_skip_errors=off#innodbinnodb_data_home_dir=/u01/ My3306/log/ibloginnodb_log_group_home_dir=/u01/my3306/log/ibloginnodb_adaptive_flushing=oninnodb_adaptive_hash _index=oninnodb_autoinc_lock_mode=1innodb_buffer_pool_instances=8#defaultinnodb_change_buffering=insertsinnodb _checksums=oninnodb_buffer_pool_size= 128minnodb_data_file_path=ibdata1:32m;ibdata2:16m:autoextendinnodb_ Doublewrite=oninnodb_file_format=barracudainnodb_file_per_table=oninnodb_flush_log_at_trx_commit=1innodb_flush _method=o_directinnodb_io_capacity=1000innodb_lock_wait_timeout=10innodb_log_buffer_size=67108864innodb_log_ File_size=1048576000innodb_log_files_in_group=4innodb_max_dirty_pages_pct=60innodb_open_files=60000innodb_ purge_threads=1innodb_read_io_threads=4innodb_stats_on_metadata=offinnodb_support_xa=oninnodb_use_native_aio= offinnodb_write_io_threads=10[Mysqld_safe]datadir=/u01/my3306/data 

12. Initialize MySQL script

Rm-rf/u01/my3306/data/*rm-rf/u01/my3306/log/iblog/*rm-rf/u01/my3306/log/binlog/*chmod-r 777/u01/my3306/data/ Chmod-r 777/u01/my3306/log/iblog/chmod-r 777/u01/my3306/log/binlog/chmod 755/u01/my3306/my.cnf./scripts/mysql_ install_db  --defaults-file=/u01/my3306/my.cnf--datadir=/u01/my3306/data--user=mysqlchmod-r 777/u01/my3306/ Data/chmod-r 777/u01/my3306/log/iblog/chmod-r 777/u01/my3306/log/binlog/
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.


log Monitoring at the time of initial
tail-f/u01/my3306/log/alert.log


**************************************************************************************************************
Error handling:
RSA private key file not found:/u01/my3306/data//private_key.pem. Some authentication plugins won't work.
RSA public key file not found:/u01/my3306/data//public_key.pem. Some authentication plugins won't work.

Here's how to fix it:
1. Check if OpenSSL is installed
$rpm-qa OpenSSL
Openssl-1.0.0-20.el6_2.5.x86_64

2. Generate public and private keys using OpenSSL
$ OpenSSL genrsa-out Mykey.pem 1024
Generating RSA private key, 1024x768 bit long modulus
..........++++++
.++++++
E is 65537 (0x10001)

$ OpenSSL rsa-in mykey.pem-pubout-out mykey.pub
Writing RSA Key


$ ll mykey*
[email protected] my3306]# ll mykey*
-rw-r--r--1 root root 891 Apr 1 20:35 Mykey.pem
-rw-r--r--1 root root 272 Apr 1 20:35 mykey.pub

3. Modify the Key's permissions
chmod 755/U01/MY3306/MYKEY.PEM
chmod 755/u01/my3306/mykey.pub
$ ll mykey*
[email protected] my3306]# ll mykey*
-rwxr-xr-x 1 root root 891 Apr 1 20:35 Mykey.pem
-rwxr-xr-x 1 root root 272 Apr 1 20:35 mykey.pub

4, add the parameter to [mysqld], namely: VI my.cnf
[Mysqld]
Sha256_password_private_key_path=/u01/my3306/mykey.pem
Sha256_password_public_key_path=/u01/my3306/mykey.pub
**********************************************************************************************

13. Start MySQL

Vi. bash_profile   Add path= $PATH---Root user: $HOME/bin:/u01/my3306/binmysqld_safe--defaults-file=/u01/my3306/ MY.CNF--user=mysql &

14. Log in to MySQL

[[email protected] ~]# mysql-h127.0.0.1-urootwelcome to the MySQL monitor. Commands End With; or \g.your MySQL connection ID is 2Server version:5.6.23-log Source distributioncopyright (c), Oracle and/or I TS affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names trademarks of their respectiveowners. Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement.mysql> show variables like '%log-bin% '; Empty Set (0.00 sec) mysql> Show variables like '%bin% '; +-----------------------------------------+---------------- --------------+| variable_name | Value |+-----------------------------------------+------------------------------+| bind_address | *                            || Binlog_cache_size | 32768 | | Binlog_checksum |          CRC32              || Binlog_direct_non_transactional_updates | OFF | | binlog_error_action | Ignore_error | | Binlog_format | ROW | | Binlog_gtid_simple_recovery | OFF | | Binlog_max_flush_queue_time | 0 | | Binlog_order_commits | On | | Binlog_row_image | Full | | binlog_rows_query_log_events | OFF | | Binlog_stmt_cache_size | 32768 | | Binlogging_impossible_mode | Ignore_error | | Innodb_api_enable_binlog | OFF | | Innodb_locks_unsafe_for_binlog | OFF | | Log_bin | On | |     Log_bin_basename                   | /u01/my3306/log/binlog | | Log_bin_index | /u01/my3306/log/binlog.index | | log_bin_trust_function_creators | OFF | | log_bin_use_v1_row_events | OFF | | Max_binlog_cache_size | 2147483648 | | Max_binlog_size | 524288000 | | Max_binlog_stmt_cache_size | 18446744073709547520 | | Simplified_binlog_gtid_recovery | OFF | | Sql_log_bin | On | | Sync_binlog | |+-----------------------------------------+------------------------------+26 rows in set (0. XX sec)

############################################################################################################### ###################

1. Initialize MySQL script: sh init3306.shrm-rf/u01/my3306/data/*rm-rf/u01/my3306/log/iblog/*rm-rf/u01/my3306/log/binlog/* Chmod-r 777/u01/my3306/data/chmod-r 777/u01/my3306/log/iblog/chmod-r 777/u01/my3306/log/binlog/chmod 755/u01/my330 6/my.cnf./scripts/mysql_install_db  --defaults-file=/u01/my3306/my.cnf--datadir=/u01/my3306/data--user= Mysqlchmod-r 777/u01/my3306/data/chmod-r 777/u01/my3306/log/iblog/chmod-r 777/u01/my3306/log/binlog/2. Start MySQL script sh Start3306.shmysqld_safe--defaults-file=/u01/my3306/my.cnf--user=mysql &3. Log in to MySQL script sh logon3306.shmysql- H127.0.0.1-uroot



Under the big environment MySQL5.6 source installation actual combat step by step teaches you centos6.5_64bit under compiles installs [email protected]

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.