tar zxvf mysql-5.5.3-m3.tar.gz cd mysql-5.5.3-m3/ ./configure --prefix=/usr/local/mysql2/ --with-tcp-port=3307 --with-unix-socket-path=/tmp/mysql2.sock --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-big
tar zxvf mysql-5.5.3-m3.tar.gz
cd mysql-5.5.3-m3/
./configure --prefix=/usr/local/mysql2/ --with-tcp-port=3307 --with-unix-socket-path=/tmp/mysql2.sock --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-big-tables --with-readline --with-ssl --with-embedded-server --enable-local-infile --with-plugins=partition,innobase,myisammrg
make && make install
cp /usr/local/mysql2/share/mysql/my-medium.cnf /etc/my2.cnf
cp /usr/local/mysql2/share/mysql/mysql.server /etc/init.d/mysql2
vi /etc/rc.d/init.d/mysql2
# Try to find basedir in /etc/my.cnf
conf=/etc/my.cnf
print_defaults=
if test -r $conf
then
# may be overwritten at next upgrade.
$bindir/mysqld_safe --defaults-file=/etc/my2.cnf --datadir="$datadir" --pid-file="$mysqld_pid_file_path" $other_args >/dev/null 2>&1 &
/usr/local/mysql2/bin/mysql_install_db --defaults-file=/etc/my2.cnf --basedir=/usr/local/mysql2/ --datadir=/usr/local/mysql2/var/ --user=mysql
chown -R mysql /usr/local/mysql2/var
chgrp -R mysql /usr/local/mysql2/.
chmod 755 /etc/init.d/mysql2
chkconfig --level 345 mysql2 on
service mysql2 start
netstat -tlnap | grep mysql
/usr/local/mysql2/bin/mysql -uroot -p --socket=/tmp/mysql2.sock
change master to master_host='0.0.0.0', master_user='replication',master_password='00000', master_log_file='mysql-bin.000005', master_log_pos=107,MASTER_PORT=3306;
原文地址:linux下安装第二个mysql实例过程, 感谢原作者分享。