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