Nine. mysql database multi-instance installation

Source: Internet
Author: User
Tags log log tmp folder

Frequent system hardware shortages, resulting in the need to install multiple MySQL instances on the same hardware server

1. Create a new mysql3306,mysql3307,mysql3308 three folder under the MySQL user directory, and create the Data,log,tmp folder under the three folders respectively, the overall directory structure is as follows

/home/mysql

            ├──mysql3306
                        ├──data
                        ├──log
                        ├──tmp
            ├──mysql3307
                        ├──data
                        ├──log
                        ├──tmp
            ├──mysql3308
                        ├──data
                        ├──log
                        ├──tmp

2. Configuring the My.cnf File
[Client]port=3306Socket=/tmp/Mysql.sock [Mysqld_multi]mysqld=/usr/local/mysql/bin/Mysqld_safemysqladmin=/usr/local/mysql/bin/Mysqladminlog=/home/mysql/Mysqld_multi.log[mysqld]user=Mysqlbasedir=/usr/local/Mysqlsql_mode=no_engine_substitution,strict_trans_tables[mysqld3306] Mysqld=mysqld mysqladmin=mysqladmin DataDir=/home/mysql/mysql3306/Data Port=3306server_id=3306Socket=/tmp/Mysql3306.sock Log-output=file Slow_query_log=1Long_query_time=1Slow_query_log_file=/home/mysql/mysql3306/log/Slow.log Log-error =/home/mysql/mysql3306/log/Error.log Binlog_format=Mixed Log-bin =/home/mysql/mysql3306/log/Mysql3306_bin[mysqld3307]mysqld=Mysqldmysqladmin=Mysqladmindatadir=/home/mysql/mysql3307/dataport=3307server_id=3307Socket=/tmp/Mysql3307.socklog-output=Fileslow_query_log=1Long_query_time=1Slow_query_log_file=/home/mysql/mysql3307/log/Slow.loglog-error =/home/mysql/mysql3307/log/Error.logbinlog_format=Mixedlog-bin =/home/mysql/mysql3307/log/Mysql3307_bin[mysqld3308]mysqld=Mysqldmysqladmin=Mysqladmindatadir=/home/mysql/mysql3308/dataport=3308server_id=3308Socket=/tmp/Mysql3308.socklog-output=Fileslow_query_log=1Long_query_time=1Slow_query_log_file=/home/mysql/mysql3308/log/Slow.loglog-error =/home/mysql/mysql3308/log/Error.logbinlog_format=Mixedlog-bin =/home/mysql/mysql3308/log/mysql3308_bin

3. Running Mysqld_multi

# start
/usr/local/mysql/bin/mysqld_multi start
# stop
/usr/local/mysql/bin/mysqld_multi stop
# Query Status
/usr/local/mysql/bin/mysqld_multi Report

Nine. mysql database multi-instance 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.