One machine, multiple mysqld services _ MySQL-mysql tutorial

Source: Internet
Author: User
Tags mysql tutorial
One machine, multiple mysqld services bitsCN.com

Have you ever installed a lot of mysqld on one machine? If so, how do we do this? Is it true that I have compiled many mysql databases in different directories and then started them one by one? If so, I strongly recommend using mysqld_multi, which can quickly configure N mysqld.
The procedure is as follows:
1) first install mysqld on the server, start and configure the mysql User
2) Copy the mysql database under the data directory to the new mysql server (N can be created)
3) configure mysqld_multi
For specific configuration, see./mysqld_multi-example


[Mysqld_multi]
Mysqld =/usr/local/mysql/bin/mysqld_safe
Mysqladmin =/usr/local/mysql/bin/mysqladmin
User = yt
Password = yangting
[Mysqld1]
Datadir =/usr/local/mysql/data/
Basedir =/usr/local/mysql
Port = 3306
Socket =/tmp/mysql. sock


[Mysqld2]
Datadir =/usr/local/mysql/data2/
Basedir =/usr/local/mysql
Port = 3307
Socket =/tmp/mysql1.sock
Pid-file =/usr/local/mysql/data2/mysql2.pid
Default-storage-engine = innodb
[Mysql]
Prompt = mysql -- // u @ // h: // d // r: // m: // s>
4) start and close

./Mysqld_multi -- log =/usr/local/mysql/data2/yt. err start
./Mysqld_multi -- log =/usr/local/mysql/data2/yt. err stop
You can also start mysqld_multi -- log =/usr/local/mysql/data2/yt. err start 1, 3-10 start
You can also./mysqld_multi -- log =/usr/local/mysql/data2/yt. err stop 2 to disable the second one.
Note: After getting up, make sure that each server has the user and password required by mysqld_mult and must be localhost.
Grant shutdown on *. * TO 'yt' @ 'localhost' identified by 'yangting ';
Otherwise, it cannot be stopped.

Author: "sky-Peng"

BitsCN.com

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.