System Environment: centos6.264-bit kernel version: 2.6.32-220. el6.x86 _ 64mysql version: 5.1.62 if you like this blog post, please give a thumbs up. For more blog posts, visit the linux open source technology blog 1, MySQL many
System Environment: centos6.264-bit kernel version: 2.6.32-220. el6.x86 _ 64mysql version: 5.1.62 if you like this blog post, please give a thumbs up. For more blog posts, visit the linux open source technology blog 1, MySQL many
System Environment: centos 6.2 64-bit
Kernel version: 2.6.32-220. el6.x86 _ 64
Mysql version: 5.1.62
If you like this blog post, please give a thumbs up, website space, and more blog posts to visit the ordinary day linux open source technology blog
I. Introduction to multiple MySQL instances and features of multiple MySQL instances in the United States
1. What is MySQL multi-instance?
Multiple MySQL instances enable multiple service ports (for example, 3306, 3307, and 3308) on one machine, run multiple MySQL service processes, and lease Hong Kong servers, different sockets are used to listen to different service ports to provide their own services.
2. MySQL multi-instance features the following:
1) effectively use server resources. When a single server resource is available, you can make full use of the remaining resources to provide more services.
2) Saving server resources
3) Resource preemption. When a service instance is highly concurrent or enables slow queries, more memory, CPU, and disk I/O resources are consumed, as a result, the quality of services provided by other instances on the server is reduced.
Ii. install and configure multiple MySQL instances
1. Create a mysql user and group:
[Root @ LVS_RS_104 ~] # Groupadd mysql
[Root @ LVS_RS_104 ~] # Useradd-s/sbin/nologin-g mysql-M mysql
2. Download the MySQL source code package and decompress it for installation.
3. mysql parameter description:
-- Prefix =/usr/local/mysql # specify the mysql installation path
-- Enable-aggreger # allows the use of the Assembly mode (to optimize performance)
-- Enable-thread-safe-client # compile mysql in thread mode
-- With-mysqld-user = mysql # specify the user of the mysql running system
-- With-big-tables # supports large tables. Even 32-bit Systems Support tables larger than 4 GB.
-- Without-debug # use non-debug mode
-- With-pthread # force pthread library Compilation
-- With-extra-charsets = complex # use complex for the mysql Default Character Set
-- With-ssl # supports ssl
-- With-plugin = partition, innobase
-- With-plugin-PLUGIN
-- With-mysqld-ldflags =-all-static # use static libraries on the server (optimizing performance)
-- With-client-ldfags =-all-static # use static libraries on the client (optimizing performance)
For more parameters, see INSTALL or./configure -- help in the source code directory.
4. Create a data directory for multiple MySQL instances
5. Create a MySQL multi-instance configuration file
The configuration is different from that of a single instance. To configure multiple configuration files, run the vim command as follows:
MySQL multi-instance configuration file my. the cnf file and the Startup File are in the attachment. You can download the file and put it in the directory of each instance. The Startup File needs to change the group and owner to mysql and add the execution permission, as shown below:
6. initialize the MySQL data directory and add the mysql command path Global Path.
7. Start MySQL multi-instance
Check the port to see if mysql is successfully started.
We found that mysql was successfully started.
MySQL multi-instance configuration file and Startup File
This article is from the "ordinary days" blog. Please keep this source