Start multiple MySQL instances on a single machine

Source: Internet
Author: User

Environment: win8,cygwin64,mysql5.6.17

Learn about the configuration file reads for MySQL and the role of some of the corresponding files

1. Create the configuration file Myinstance2.ini, which is configured as
[Mysqld]
Basedir=/usr/local/mysql
Datadir=/cygdrive/d/temp1/myinstance2/data
port=3312
Server_id=101
Socket=/var/lib/mysql/mysql_instatnce2.sock
Pid-file= Mysql_instatnce2.pid

2. Start the server
./bin/mysqld.exe--defaults-file=/cygdrive/d/temp1/myinstance2/myinstance2.ini

3. Connect to the server
./bin/mysql.exe-uroot--socket=/var/lib/mysql/mysql_instatnce2.sock

4. Stop the server
./bin/mysqladmin.exe-uroot--socket=/var/lib/mysql/mysql_instatnce2.sock Shutdown

5. Special Instructions
DataDir: Each instance must point to its own path to the data file, or the second server that starts will have an error
Socket: Used to specify the socket file. If you do not specify the contents of the file separately, the MySQL server that is started will overwrite the contents of the former

In a Windows environment, using the symbol \ As a path may cause the correct path to be found, such as "Mysqld-debug.exe:can ' t change dir to ' D:\temp1\mysql\bin\ emp1\mysql\data\ ' (errcode:22-invalid argument) ' Error

6, reference 1-5 for the new instance configuration

Reference:
Http://blog.163.com/[email protected]/blog/static/16493457220110266112909/
Description: Strace for Debugging program startup

Http://tech.ddvip.com/2013-07/1374869135199784.html
Description: Multi-instance configuration

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.