MYSQL5.5 Linux Multi-instance

Source: Internet
Author: User

installation process

   cmake Installation Reference previous article https://www.cnblogs.com/lixuchun/p/9240888.html

Multiple instances use the/data directory as the total root of MySQL multi-instance, and then plan different MySQL instance ports as the level two directory under/data, different ports

is a different instance directory, to distinguish between different instances, the level two directory contains MySQL data files, configuration files and the directory of the files that are launched.

  

On the basis of the original

Remove the start command rm-f/etc/init.d/mysqld

  

Create directory mkdir-p/data/{3306,3307}/data

  View Create directory Tree--charset ascii/data garbled problem

Description: 3306 is a 3306 instance directory data file that is an instance

  

    ( general configuration of production hardware MEM32G Dual CPU 8-core disk 6*600g SAS 15k 2-3 instances)

  

Configure a configuration file for multiple instances

  Cp/application/mysql/support-files/my-medium.cnf/data/3306/my.cnf

  Cp/application/mysql/support-files/my-medium.cnf/data/3307/my.cnf

  

Modify the files under My.cnf files 3306 and 3307 to modify

  3307 under server_id = 2

[Client]Port= 3306Socket=/data/3306/mysql.sock[mysqld]Port= 3306Socket=/data/3306/mysql.sockbasedir=/application/mysql-5.5.32DataDir=/data/3306/dataskip-external-lockingkey_buffer_size=16mmax_allowed_packet=1mtable_open_cache= 64sort_buffer_size=512knet_buffer_length=8kread_buffer_size=256kread_rnd_buffer_size=512kmyisam_sort_buffer_size=8mskip-name-resolvelog-bin=Mysql-binbinlog_format=mixedmax_binlog_size=500MServer-id = 1[Mysqld_safe]Log-error=/data/3306/ilanni.errpid-file=/data/3306/ilanni.pid[mysqldump]Quickmax_allowed_packet=16M[MySQL]No-auto-rehash[Myisamchk]key_buffer_size=20msort_buffer_size=20mread_buffer=2mwrite_buffer=2M[mysqlhotcopy]Interactive-timeout

Initialize some file library tables for 2 instance generation systems, etc.

  /application/mysql-5.5.32/scripts/mysql_install_db--basedir=/application/mysql-5.5.32--datadir=/data/3306/data --user=mysql

  

  /application/mysql-5.5.32/scripts/mysql_install_db--basedir=/application/mysql-5.5.32--datadir=/data/3307/data --user=mysql

  

Modify Database Permissions

Chown-r mysql:mysql/data/3306

Chown-r mysql:mysql/data/3307

  

Start the database

  /application/mysql-5.5.32/bin/mysqld_safe--DEFAULTS-FILE=/DATA/3306/MY.CNF &

/application/mysql-5.5.32/bin/mysqld_safe--DEFAULTS-FILE=/DATA/3307/MY.CNF &

  

See if it starts

  netstat-lnt | GREP 330 Project has started

  

Login

  Mysql-uroot-p-s/data/3306/mysql.sock

  

Add root password

  Mysqladmin-u root-s/data/3306/mysql.sock password ' 101022li '

Mysqladmin-u root-s/data/3307/mysql.sock password ' 101022li '

  

  

Stopping the database

  /application/mysql-5.5.32/bin/mysqladmin-uroot-p-s/data/3306/mysql.sock shutdown

/application/mysql-5.5.32/bin/mysqladmin-uroot-p-s/data/3307/mysql.sock shutdown

  

  

MYSQL5.5 Linux Multi-instance

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.