mysql-5.6 Installation

Source: Internet
Author: User
Tags uuid

One, download unzip mysql5.6 binary file community version

[Email protected] bjia]# tar zxvf mysql-5.6.23-linux-glibc2.5-x86_64.tar.gz-c/usr/local/

Second, create a soft connection

Ln-s Mysql-5.6.23-linux-glibc2.5-x86_64/mysql

Iii. creating MySQL users and user groups

[[Email protected]~]# groupadd mysql[[email protected] ~]# useradd-r-s/sbin/nologin-g MySQL MySQL

Iv. MySQL Database initialization

[Email protected] bjia]#/usr/local/mysql/scripts/mysql_install_db--basedir=/usr/local/mysql--datadir=/usr/local /mysql/data/4001/--user=mysql[[email protected] bjia]#/usr/local/mysql/scripts/mysql_install_db--basedir=/usr/ Local/mysql--datadir=/usr/local/mysql/data/4003/--user=mysql

V. Configuring MySQL multi-instance my.cnf

[Mysqld_multi] mysqld = /usr/local/mysql/bin/mysqld_safe mysqladmin = /usr/local /mysql/bin/mysqladmin  #user  = your_user  #password  = your_password [mysqld1]  server-id = 4100relay-log =/usr/local/mysql/4001_log/relay-logbasedir = /usr/ local/mysqldatadir = /usr/local/mysql/data/4001port = 4001socket = /tmp/ mysql4001.sock  #log_bin_trust_function_creators =1#log-bin=/usr/local/mysql/3003_log/mysql-bin#binlog_ format=mixed  #binlog_cache_size  = 32m expire_logs_days = 3 sync-binlog                      =  1innodb_flush_log_at_trx_commit =  1innodb_data_file_path =  IBDATA1:12M:AUTOEXTENDINNODB_LOG_FILES_IN_GROUP = 2INNODB_LOG_FILE_SIZE = 512M[MYSQLD2] Server-id = 4200relay-log =/usr/local/mysql/4003_log/relay-logbasedir = /usr/local/mysqldatadir = /usr/local/ mysql/data/4003port = 4003socket = /tmp/mysql4003.sock#log_bin_trust_function_creators=1# log-bin=/usr/local/mysql/3003_log/mysql-bin#binlog_format=mixed  #binlog_cache_size  = 32M  expire_logs_days = 3sync-binlog                     =  1innodb_flush_log_at_trx_commit =   1innodb_data_file_path = ibdata1:12M:autoextendinnodb_log_files_in_group =  2innodb_log_file_size = 512m

Vi. configuring MySQL Multi-instance startup scripts

[Email protected] mysql]# cp/usr/local/mysql/bin/mysqld_multi/usr/bin/

Vii. Delegation of authority

[Email protected] mysql]# chown-r mysql.mysql/usr/local/mysql/data/4001/[[email protected] mysql]# chown-r mysql.mysq L/usr/local/mysql/data/4003/[[email protected] mysql]# Mkdir/usr/local/mysql/4001_log[[email protected] mysql]# Mkdir/usr/local/mysql/4003_log[[email protected] mysql]# chown-r Mysql.mysql/usr/local/mysql/4001_log[[email Protected] mysql]# chown-r Mysql.mysql/usr/local/mysql/4003_log

Viii. starting the database

[[email protected] mysql]# Mysqld_multi start 1-2

Ix. viewing logs and services

[[email protected] 4003]# tail -f renmaitong.err 2015-05-12 16:52:32  24418 [note] innodb: waiting for purge to start2015-05-12 16:52:32  24418 [Note] InnoDB: 5.6.23 started; log sequence number  16259872015-05-12 16:52:32 24418 [warning] no existing uuid has been  found, so we assume that this is the first time that  this server has been started. Generating a new UUID:  3a6ad7f2-f884-11e4-9cb9-f01fafda7a2d.2015-05-12 16:52:32 24418 [note] server hostname   (bind-address):  ' * ';  port: 40032015-05-12 16:52:32 24418 [note] ipv6  is not available.2015-05-12 16:52:32 24418 [Note]   -  ' 0.0.0.0 '  resolves to  '0.0.0.0 '; 2015-05-12 16:52:32 24418 [note] server socket created on ip:   ' 0.0.0.0 '. 2015-05-12 16:52:32 24418 [note] event scheduler: loaded 0  events2015-05-12 16:52:32 24418 [Note] /usr/local/mysql/bin/mysqld: ready  For connections. version:  ' 5.6.23 '   socket:  '/tmp/mysql4003.sock '   port: 4003   mysql community server  (GPL) [[email protected] 4001]# tail -f  renmaitong.err 2015-05-12 16:52:32 24419 [note] innodb: waiting for  purge to start2015-05-12 16:52:32 24419 [note] innodb: 5.6.23 started;  log sequence number 16259872015-05-12 16:52:32 24419 [warning] no  existing UUID has been found, so we assume that this  is The first time that this server has been started. generating  a new uuid: 3a5ef2c0-f884-11e4-9cb9-f01fafda7a2d.2015-05-12 16:52:32 24419  [Note] Server hostname  (bind-address):  ' * '; port: 40012015-05-12  16:52:32 24419 [note] ipv6 is not available.2015-05-12 16:52:32 24419  [Note]   -  ' 0.0.0.0 '  resolves to  ' 0.0.0.0 '; 2015-05-12 16:52:32  24419 [Note] Server socket created on IP:  ' 0.0.0.0 ' .2015-05-12  16:52:32 24419 [note] event scheduler: loaded 0 events2015-05-12  16:52:32 24419 [note] /usr/local/mysql/bin/mysqld: ready for connections. version:  ' 5.6.23 '   socket:  '/tmp/mysql4001.sock '   port: 4001   mysql community server  (GPL)It means the server is up. 

X. LOGIN Database

[Email protected] 4001]# mysql-uroot-s/tmp/mysql4001.sock[[email protected] 4001]# mysql-uroot-s/tmp/mysql4003.sock

Xi. Stop Database

[Email protected] 4001]# mysqladmin-u root-s/tmp/mysql4001.sock shutdown [[email protected] 4001]# mysqladmin-u root -s/tmp/mysql4003.sock shutdown


This article is from the "struggling veterans" blog, make sure to keep this source http://jiaxu201.blog.51cto.com/4569604/1650707

mysql-5.6 Installation

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.