系统环境:centos 6.2 64位
- [root@LVS_RS_104 ~]# groupadd mysql
- [root@LVS_RS_104 ~]# useradd -s /sbin/nologin -g mysql -M mysql
- [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
- [root@LVS_RS_104 mysql-5.1.62]# mkdir /usr/local/mysql/data/{3306,3307,3308}/data -p
- [root@LVS_RS_104 mysql-5.1.62]# tree /usr/local/mysql/data/
- /usr/local/mysql/data/
- ├── 3306
- │ └── data
- ├── 3307
- │ └── data
- └── 3308
- └── data
- 6 directories, 0 files
- [root@LVS_RS_104 data]# vim /usr/local/mysql/data/3306/my.cnf
- [root@LVS_RS_104 data]# vim /usr/local/mysql/data/3307/my.cnf
- [root@LVS_RS_104 data]# vim /usr/local/mysql/data/3308/my.cnf
- [root@LVS_RS_104 data]# chown mysql.mysql /usr/local/mysql/data/3306/mysql
- [root@LVS_RS_104 data]# chown mysql.mysql /usr/local/mysql/data/3307/mysql
- [root@LVS_RS_104 data]# chown mysql.mysql /usr/local/mysql/data/3308/mysql
- [root@LVS_RS_104 data]# chmod +x /usr/local/mysql/data/3306/mysql
- [root@LVS_RS_104 data]# chmod +x /usr/local/mysql/data/3307/mysql
- [root@LVS_RS_104 data]# chmod +x /usr/local/mysql/data/3308/mysql
- [root@LVS_RS_104 data]# echo 'export PATH=$PATH:/usr/local/mysql/bin/' >>/etc/profile
- [root@LVS_RS_104 data]# source /etc/profile
- [root@LVS_RS_104 data]# mysql_install_db --basedir=/usr/local/mysql --datadir=/usr/local/mysql/
- data/3306/data/
- [root@LVS_RS_104 data]# mysql_install_db --basedir=/usr/local/mysql --datadir=/usr/local/mysql/
- data/3307/data/
- [root@LVS_RS_104 data]# mysql_install_db --basedir=/usr/local/mysql --datadir=/usr/local/mysql/
- data/3308/data/
- [root@LVS_RS_104 3306]# ./mysql start
- Starting MySQL...
- [root@LVS_RS_104 3306]# ../3307/mysql start
- Starting MySQL...
- [root@LVS_RS_104 3306]# ../3308/mysql start
- Starting MySQL...