Running multiple MySQL services on the same computer

Source: Internet
Author: User
Tags manual mysql in linux

The first part is to build multiple MySQL services on a server.

One, Introduction

In MySQL, there is a mysqld_multi command, can be used in a physical server to run multiple MySQL services, today reference some documents, personally tested and passed, really happy, now the operation of the process to share to everyone!

Operating system: Linux 2.6.13 (Slackware), other Linux should also be similar.

Database: Mysql 4.0.17 source program installation (I believe the latest 5.1.* is also similar, try again some days)

Planning: Running 4 MySQL services:

Assume server name: Db-app (IP is 192.168.0.100),

Assume server name: DB-APP2 (IP is 192.168.0.101),

The following is the second part, which tells about MySQL in Db-app,

Second, prepare

With the MySQL source program installed, assuming the installation of Configura with the choice of chlorine?

./configure--prefix=/usr/local/mysql--datadir=/usr/local/mysql/data1--sysconfdir=/etc

Note:--prefix will install MySQL to/usr/local/mysql,

--datadir Build the database/usr/local/mysql/data1

Sysconfdir is the search path for the MY.CNF configuration file that specifies that MySQL uses as/etc

Other MySQL installation process slightly.

As mentioned in the MySQL management manual: Each MySQL service can be standalone, so it calls a different startup option in a MY.CNF-the GNR value mentioned below, the use of different ports, the generation of the respective sockets file, and the service database is independent ( For more access to the official MySQL website English Management manual.

Mysqld_multi is a service process that manages multiple mysqld, and these service process programs have different UNIX sockets or are listening on different ports. He can start, stop, and monitor the current service status.

----program searches for [mysqld#] segments in MY.CNF (or in--config-file custom profiles), "#" can be any positive integer. This positive integer is the sequence of segments mentioned below, that is, the GNR. The sequence number of the segment is mysqld_multi to distinguish the different segments so that you can control the start, stop, or get his report information for a particular mysqld process. The parameters in these groups are the same as the parameters of the group needed to start a mysqld. However, if you are using multiple services, you must specify a UNIX socket or port for each service (excerpted from http://mifor.4dian.org using the Mysqld_multi program to manage multiple MySQL services).

From the above text you can see that the most important thing in the MySQL service is the my.cnf configuration file.

Now I post my my.cnf file.-----------------------

[Mysqld_multi]

Mysqld =/usr/local/mysql/bin/mysqld_safe

Mysqladmin =/usr/local/mysql/bin/mysqladmin

Related Article
Large-Scale Price Reduction
  • 59% Max. and 23% Avg.
  • Price Reduction for Core Products
  • Price Reduction in Multiple Regions
undefined. /
Connect with us on Discord
  • Secure, anonymous group chat without disturbance
  • Stay updated on campaigns, new products, and more
  • Support for all your questions
undefined. /
Free Tier
  • Start free from ECS to Big Data
  • Get Started in 3 Simple Steps
  • Try ECS t5 1C1G
undefined. /

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.