mysql5.6.20 binary Installation Deployment documentation
First, business needs:
mysql5.5.48 running on a single server line
Now it is not affecting the line of business, do not stop the mysql5.5 database on the line to deploy another mysql5.6.20 instance
II. installation and deployment process:
2.1 Installation Deployment Process considerations:
When initializing the MySQL database, it will look for the MY.CNF configuration file, which is sequential, the default order is:
[[email protected] ~]# MySQL--help | grep ' Default options '-A 1
Default options is read from the following files in the given order:
/ETC/MY.CNF/ETC/MYSQL/MY.CNF/USR/LOCAL/MYSQL/ETC/MY.CNF ~/.my.cnf
See which profile the current MySQL runtime is using:
[Email protected] ~]# cat/proc/$ (pidof mysqld)/cmdline | Tr ' + ' \ n '
/usr/local/mysql5.6/bin/mysqld
--defaults-file=/usr/local/mysql5.6/my.cnf
--basedir=/usr/local/mysql5.6
--datadir=/data/mysql3307/data
--plugin-dir=/usr/local/mysql5.6/lib/plugin
--user=mysql
--log-error=/data/mysql3307/log/error.log
--open-files-limit=65535
--pid-file=/data/mysql3307/log/git-server.pid
--socket=/tmp/mysql3307.sock
--port=3307
Tip: The above command is only suitable for viewing single instance MySQL
Reference: https://www.electrictoolbox.com/mysql-my-cnf/
https://www.psce.com/en/blog/2012/04/01/how-to-find-mysql-configuration-file/
2.2 Start Deployment:
Note: To use the current line running mysql5.5.48 MY.CNF profile MV to another name, otherwise in the initialization of the mysql5.6 will be an error. The reason is: when initializing mysql5.6, the default is to look for/etc/my.cnf this file first. But this file is being used by mysql5.5.48, so rename the file, then move the mysql5.6.20 my.cnf configuration file to/usr/local/mysql5.6/, then initialize mysql5.6.20
Mv/etc/my.cnf/etc/my.cnf.bak
If you do not rename the mysql5.5.48 my.cnf configuration file on the line, the initialization mysql5.6.20 will report the following error:
[Email protected] scripts]#/mysql_install_db--datadir=/data/mysql3307/data--basedir=/usr/local/mysql5.6--user= MySQL--explicit_defaults_for_timestamp
Installing MySQL system tables ... 2017-08-27 14:04:28 0 [Note] ignoring--secure-file-priv value as server is running with--bootstrap.
2017-08-27 14:04:28 0 [Note]/usr/local/mysql5.6/bin/mysqld (mysqld 5.6.36-log) starting as Process 7379 ...
2017-08-27 14:04:28 7379 [Note] innodb:using Atomics to ref count buffer pool pages
2017-08-27 14:04:28 7379 [Note] innodb:the InnoDB memory heap is disabled
2017-08-27 14:04:28 7379 [Note] innodb:mutexes and rw_locks use GCC atomic builtins
2017-08-27 14:04:28 7379 [Note] innodb:memory barrier is not used
2017-08-27 14:04:28 7379 [Note] innodb:compressed tables use zlib 1.2.3
2017-08-27 14:04:28 7379 [Note] innodb:using Linux native AIO
2017-08-27 14:04:28 7379 [Note] innodb:using CPU CRC32 Instructions
2017-08-27 14:04:28 7379 [Note] innodb:initializing buffer pool, size = 1.0G
2017-08-27 14:04:28 7379 [Note] innodb:completed initialization of buffer pool
2017-08-27 14:04:28 7379 [ERROR] innodb:unable to Lock/usr/local/mysql/var/ibdata1, error:11
2017-08-27 14:04:28 7379 [Note] innodb:check that does not already has another mysqld process using the same InnoDB da Ta or log files.
2017-08-27 14:04:28 7379 [Note] innodb:retrying to lock the first data file
2017-08-27 14:04:29 7379 [ERROR] innodb:unable to Lock/usr/local/mysql/var/ibdata1, error:11
2017-08-27 14:04:29 7379 [Note] innodb:check that does not already has another mysqld process using the same InnoDB da Ta or log files.
2017-08-27 14:04:30 7379 [ERROR] innodb:unable to Lock/usr/local/mysql/var/ibdata1, error:11
2017-08-27 14:04:30 7379 [Note] innodb:check that does not already has another mysqld process using the same InnoDB da Ta or log files.
2017-08-27 14:04:31 7379 [ERROR] innodb:unable to Lock/usr/local/mysql/var/ibdata1, error:11
2017-08-27 14:04:31 7379 [Note] innodb:check that does not already has another mysqld process using the same InnoDB da Ta or log files.
2017-08-27 14:04:32 7379 [ERROR] innodb:unable to Lock/usr/local/mysql/var/ibdata1, error:11
2017-08-27 14:04:32 7379 [Note] innodb:check that does not already has another mysqld process using the same InnoDB da Ta or log files.
2017-08-27 14:04:33 7379 [ERROR] innodb:unable to Lock/usr/local/mysql/var/ibdata1, error:11
2017-08-27 14:04:33 7379 [Note] innodb:check that does not already has another mysqld process using the same InnoDB da Ta or log files.
So you have to first rename the mysql5.5.48 my.cnf profile on the line (remember that during this period do not have any changes to the mysql5.5.48 to start the service operation), After mysql5.6.20 successful deployment, remember to change the renamed mysql5.5.48 configuration file back to the original/etc/my.cnf
MySQL binary package
http://ftp.ntu.edu.tw/MySQL/Downloads/MySQL-5.6/
Useradd MySQL
Mkdir/data1/mysql5.6/{data,var}-P
Chown-r mysql.mysql/data1/mysql5.6/
Tar xf/tmp/mysql-5.6.20-linux-glibc2.5-x86_64.tar.gz-c/usr/local/
cd/usr/local/
MV Mysql-5.6.20-linux-glibc2.5-x86_64 mysql5.6
Chown-r mysql.mysql/usr/local/mysql5.6
CP my.cnf (mysql5.6.20 configuration file)/usr/local/mysql5.6/
Cd/usr/local/mysql5.6/scripts
[Email protected] scripts]#/mysql_install_db--datadir=/data/mysql5.6/data--basedir=/usr/local/mysql5.6--user= MySQL--explicit_defaults_for_timestamp
Installing MySQL system Tables.../usr/local/mysql/bin/mysqld:error while loading shared libraries:libaio.so.1:cannot O Pen shared object File:no such file or directory
Solve:
Yum-y install Libaio-devel or yum install libaio*
./mysql_install_db--datadir=/data1/mysql5.6/data--basedir=/usr/local/mysql5.6--user=mysql--explicit_defaults_ For_timestamp
cp/usr/local/mysql/support-files/mysql.server/etc/init.d/mysql5.6
Sed-i ' S#/usr/local/mysql5.6#/usr/local/mysql#g '/etc/init.d/mysql5.6
Chkconfig mysql5.6 on
echo "Export path= $PATH:/usr/local/mysql5.6/bin" >/etc/profile.d/mysql.sh
Source/etc/profile
2.3 Start mysql5.6.20 Setup password:
The first way to start MySQL
/etc/init.d/mysql5.6 start
The second way to start MySQL
Mysqld_safe--DEFAULTS-FILE=/USR/LOCAL/MYSQL5.6/MY.CNF &
Ps-ef|grep MySQL
To set a password for mysql5.6.20:
/usr/local/mysql5.6/bin/mysqladmin-u root password ' Zydfg55726 '-s/tmp/mysql3307.sock
Mysql-uroot-p-s/tmp/mysql3307.sock
Smooth Close mysql5.6.20:
Mysqladmin-uroot-p ' Zydfg55726 '-s/tmp/mysql3307.sock shutdown
/etc/init.d/mysql5.6 stop
2.4 mysql5.6.20 my.cnf configuration file:
[Email protected] ~]# CAT/ETC/MY.CNF
[Client]
#password= Your_password
Port= 3307
Socket=/tmp/mysql3307.sock
[Mysqld]
Port= 3307
Socket=/tmp/mysql3307.sock
DataDir =/data1/mysql5.6/data
Skip-external-locking
Key_buffer_size = 32M
Max_allowed_packet = 50M
Table_open_cache = 1024
Sort_buffer_size = 4M
Net_buffer_length = 8K
Read_buffer_size = 4M
Read_rnd_buffer_size = 512K
Myisam_sort_buffer_size = 64M
Thread_cache_size = 128
#query_cache_size = 128M
Tmp_table_size = 64M
max_join_size=3g
#skip-networking
Skip-name-resolve
Max_connections = 500
max_connect_errors = 1000
Open_files_limit = 65535
#log-bin=mysql-bin
#binlog_format =row
Server-id= 1
#expire_logs_days = 1
#default_storage_engine = InnoDB
Innodb_data_home_dir =/data1/mysql5.6/var
Innodb_data_file_path = Ibdata1:300m:autoextend
Innodb_log_group_home_dir =/data1/mysql5.6/var
Innodb_buffer_pool_size = 1024M
Innodb_additional_mem_pool_size = 2M
Innodb_log_file_size = 256M
Innodb_log_buffer_size = 8M
Innodb_flush_log_at_trx_commit = 0
Innodb_lock_wait_timeout = 50
#innodb_force_recovery = 2
[Mysqldump]
Quick
Max_allowed_packet = 256M
[MySQL]
No-auto-rehash
[Myisamchk]
Key_buffer_size = 16M
Sort_buffer_size = 4M
Read_buffer = 2M
Write_buffer = 2M
[Mysqlhotcopy]
Interactive-timeout
To open another instance on this single server mysql5.6.20 successfully completed. And it's not going to have any effect on the online mysql5.5.48 business.
This article is from the "10931853" blog, please be sure to keep this source http://wujianwei.blog.51cto.com/10931853/1959711
mysql5.6.20 binary Installation Deployment documentation