MySQL多版本安装在同一linux主机上
时间:2008-11-20 来源:ruochen
我的环境:
我的主机是CentOS5.2,已经安装了默认自带的mysql5045,现在想安装最新的5129和607来做测试
安装注意事项:
配置时的路径如下填写
./configure --with-tcp-port=5506 --with-unix-socket-path=/opt/MySQL5129 --prefix=/opt/MySQL5129
./configure --with-tcp-port=5507 --with-unix--socket-path=/opt/MySQL607 --prefix=/opt/MySQL607
--with-unix-socket-path这个参数可以不要,最后在my.cnf里面指定socket文件存放在什么路径
make
make install
这两步就没有什么好说的了
安装后的配置:
初始化数据库权限表
./mysql_install_db --basedir=/opt/MySQL5129 --datadir=/opt/MySQL5129/var --user=mysql
./mysql_install_db --basedir=/opt/MySQL607 --datadir=/opt/MySQL607/var --user=mysql
配置/etc/my.cnf参数文件: [mysqld5129]
port=5506
socket=/tmp/mysql5129.sock
basedir=/opt/MySQL5129
datadir=/opt/MySQL5129/var
user=mysql
log-error=/var/log/mysqld5129.log
pid-file=/tmp/mysqld5129.pid
[mysqld607]
port=5507
socket=/tmp/mysql607.sock
basedir=/opt/MySQL607
datadir=/opt/MySQL607/var
user=mysql
log-error=/var/log/mysqld607.log
pid-file=/tmp/mysqld607.pid
启动数据库: /opt/MySQL5129/bin/mysqld_multi start|stop 5129 /opt/MySQL607/bin/mysqld_multi start|stop 607 连接数据库: mysql --socket=/tmp/mysql5129.sock
mysql --socket=/tmp/mysql607.sock CU的yejr也推荐用mysqlmanager来管理mysql 有时间安装mysqlmanager来看看
./mysql_install_db --basedir=/opt/MySQL607 --datadir=/opt/MySQL607/var --user=mysql
配置/etc/my.cnf参数文件: [mysqld5129]
port=5506
socket=/tmp/mysql5129.sock
basedir=/opt/MySQL5129
datadir=/opt/MySQL5129/var
user=mysql
log-error=/var/log/mysqld5129.log
pid-file=/tmp/mysqld5129.pid
[mysqld607]
port=5507
socket=/tmp/mysql607.sock
basedir=/opt/MySQL607
datadir=/opt/MySQL607/var
user=mysql
log-error=/var/log/mysqld607.log
pid-file=/tmp/mysqld607.pid
启动数据库: /opt/MySQL5129/bin/mysqld_multi start|stop 5129 /opt/MySQL607/bin/mysqld_multi start|stop 607 连接数据库: mysql --socket=/tmp/mysql5129.sock
mysql --socket=/tmp/mysql607.sock CU的yejr也推荐用mysqlmanager来管理mysql 有时间安装mysqlmanager来看看
相关阅读 更多 +