Mysql Multi-Instance implementation steps

Source: Internet
Author: User

Basic theory: The use of the same set of installers, different configuration files, different startup programs, different data directories. There are public resources, and there are private resources.

Implementation steps:

1, the normal installation of MySQL, binary installation or compilation installation.

2, create MySQL multi-instance total directory, the total directory under the creation of sub-directories, such as 3306,3307, such as directory, each sample directory to create the data folder for the database folder.

3, CP support-files directory Small configuration file to 3306,3307 directory, modify the necessary parameters as follows: Sock directory, data directory, Server-id, listening port number.

4, the total data directory permissions set Chown-r Mysql:mysql/data, if the MySQL users and groups have been created.

5, set up the startup script to put under the respective instance, and give executable permissions 755.mysql command path variable needs to be configured under Etc/profiles, convenient to invoke safe startup command. Start the script internally note the differences between the port number, Basedir and DataDir definitions.

TIP1: multiple example launches are essentially started with the Msyqld_safe specified configuration file.

TIP2: Prevent error output >/dev/null > 2>&1 or 2>&1 >/dev/null &

6, MySQL initialization, 5.5 version after using script under the Foot command, respectively initialization

./mysql_install_db--basedir=/mysql installation directory/--datadir=/database directory/--user=mysql

7, start two instances respectively (essentially Mysqld_safe start mode)

/data/3306/mysql start

/data/3307/mysql start

There will be a OK prompt for success.

(The MySQL script here is pre-edited, and start is the parameter passed to the MySQL script)

8, check the instance boot situation netstat-lntup |grep 330* Check whether 3306 and 3307 ports are listening successfully.

Mysql Multi-Instance implementation steps

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.