我的linux服务器上原来有别人装的个mysql 3.x 版本很低,
因为上面跑了好几个网站,不敢动他。但是现在要做的新应用想基于 5.1开发,所以想请教下如何在保持原有的 3.x 版本的基础上,安装一个 5.1 版本的 mysql. 我想安装到不同端口应该是可以的,但是就是不知道怎么操作。

解决方案 »

  1.   

    我下了个 5.0 的 rpm 尝试直接安装,提示和当前版本冲突:[root@test neil]# rpm -i MySQL-server-community-5.0.37-0.rhel3.i386.rpm
    warning: MySQL-server-community-5.0.37-0.rhel3.i386.rpm: V3 DSA signature: NOKEY, key ID 5072e1f5
    error: Failed dependencies:
            MySQL conflicts with mysql-3.23.58-16.FC3.1.i386
            MySQL-server conflicts with mysql-server-3.23.58-16.FC3.1.i386
      

  2.   

    既然担心搞坏现有的产品,就不要在这台机器上干活了,都是mysql总是会有影响的。如果你真的要干,用rpm的--prefix或者--relocate。还是劝你换台机器,这么搞完了,你用起来也麻烦。
      

  3.   

    1.源代码mysql-5.1.16-beta.tar.gz
    2.解压 shell>tar zxvf mysql-5.1.16-beta.tar.gz
    3.shell>cd mysql-5.1.16-beta
    4.shell>./configure --prefix=/usr/local/mysql51 --with-charset=gb2312 --with-extra-charset=all --with-unix-socket-path=/tmp/mysql-new.sock --with-tcp-port=3307
    5.shell>make
    6.shell>make install
    7.shell>scpits/mysql_install_db --user=mysql
    8.shell>cd /usr/local/mysql51
      shell>bin/mysqld_safe --socket=/tmp/mysql-new.sock --port=3307 &
    9.shell>bin/mysql --socket=/tmp/mysql-new.sock --port=3307
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 1
    Server version: 5.1.16-beta-log Source distribution
     
    Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
     
    mysql> 
    参考一下手册吧
    http://dev.mysql.com/doc/refman/5.1/en/multiple-unix-servers.html
      

  4.   

    谢谢, hy2003fly.这些资料对我比较有帮助。
      

  5.   

    按照 hy2003fly 的办法搞定了。多谢。