System environment: CentOS 6.2 64-bit
Kernel version: 2.6.32-220.el6.x86_64
MySQL version: 5.1.62
One, MySQL multi-instance introduction and MySQL multi-instance features
1, what is a MySQL multiple instances?
MySQL multiple instances is on a machine to open a number of different service ports (such as: 3306,3307,3308), running multiple MySQL service process, through different sockets listening to different service ports to provide their own services.
2, MySQL multiple instances of the characteristics of the following points:
1, effective use of server resources, when a single server resources have surplus, you can make full use of the remaining resources to provide more services.
2), Save server resources
3, resource preemption problem, when a service instance service concurrency is very high, or open slow query, will consume more memory, CPU, disk IO resources, resulting in other instances on the server to provide service quality degradation.
Second, MySQL multi-instance installation configuration
1, first create MySQL users and groups:
[root@lvs_rs_104 ~]# groupadd mysql
[root@lvs_rs_104 ~]# useradd-s/sbin/nologin-g mysql-m MySQL
2, download the MySQL source package and decompression installation
[root@lvs_rs_104 ~]# wget http://mysql.ntu.edu.tw/Downloads/MySQL-5.1/mysql-5.1.62.tar.gz
[root@lvs_rs_104 ~]# Tar zxvf mysql-5.1.62.tar.gz
[root@lvs_rs_104 ~]# cd mysql-5.1.62
[root@lvs_rs_104 mysql-5.1.62]#./configure --prefix=/usr/local/mysql--enable-assembler--enable-thread-safe-client--with-mysqld-user=mysql-- With-big-tables--without-debug--with-pthread--with-extra-charsets=complex--with-readine--with-ssl-- With-embedded-server--enable-local-infole--with-plugin=partition,innobase--with-plugin-plugin-- With-mysqld-ldflags=-all-static--with-client-ldfags=-all-static
[root@lvs_rs_104 mysql-5.1.62]# Make & & Make Install
3 MySQL parameter description:
--prefix=/usr/local/mysql #指定mysql的安装路径
--enable-assembler #允许使用汇编模式 (optimized performance)
--enable-thread-safe-client #以线程方式编译mysql
--with-mysqld-user=mysql #指定mysql运行的系统的用户
--with-big-tables #支持大表, even 32-bit systems can support more than 4G of tables
--without-debug #使用非debug模式
--with-pthread #强制使用pthread线程库编译
--with-extra-charsets=complex #mysql默认的字符集使用complex
--with-ssl #支持ssl
--with-plugin=partition,innobase
--with-plugin-plugin
--with-mysqld-ldflags=-all-static #服务器使用静态库 (optimized performance)
--with-client-ldfags=-all-static #客户端使用静态库 (optimized performance)
More parameters see the source directory install or./configure--help