在mysql中运行多个mysql实例

前端之家收集整理的这篇文章主要介绍了在mysql中运行多个mysql实例 前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

我想在同一台计算机的两个不同端口上使用MySQL服务器.我做了两个单独的配置文件.当我尝试在定义的第二个端口上连接到MysqL服务器时,则无法连接.运行MysqL的操作系统是Windows Vista.指定端口后,我还尝试从命令行启动MysqLd.

这是我已更改的示例文件,供MysqL服务器从两个不同的端口读取:

  1. # CLIENT SECTION
  2. # ----------------------------------------------------------------------
  3. #
  4. # The following options will be read by MysqL client applications.
  5. # Note that only client applications shipped by MysqL are guaranteed
  6. # to read this section. If you want your own MysqL client program to
  7. # honor these values,you need to specify it as an option during the
  8. # MysqL client library initialization.
  9. #
  10. [client]
  11. port=3306
  12. [MysqL]
  13. MysqL-path="C:\Program Files\MysqL\MysqL Server 5.1\bin"
  14. default-character-set=latin1
  15. [client]
  16. port=3307
  17. [MysqL1]
  18. MysqL1-path="C:\Program Files\MysqL2\MysqL Server 5.1\bin"
  19. default-character-set=latin1
  20. # SERVER SECTION
  21. # ----------------------------------------------------------------------
  22. #
  23. # The following options will be read by the MysqL Server. Make sure that
  24. # you have installed the server correctly (see above) so it reads this
  25. # file.
  26. #
  27. [MysqLd]
  28. MysqLd-path="C:\Program Files\MysqL\MysqL Server 5.1\bin\"
  29. # The TCP/IP Port the MysqL Server will listen on
  30. port=3306
  31. #Path to installation directory. All paths are usually resolved relative to this.
  32. basedir="C:/Program Files/MysqL/MysqL Server 5.1/"
  33. #Path to the database root
  34. datadir="C:/ProgramData/MysqL/MysqL Server 5.1/Data/"
  35. #
  36. server_id=1
  37. [MysqLd1]
  38. # The TCP/IP Port the MysqL Server will listen on
  39. port=3307
  40. server_id=2
  41. MysqLd1-path="C:\Program Files\MysqL2\MysqL Server 5.1\bin\"
  42. #Path to installation directory. All paths are usually resolved relative to this.
  43. basedir="C:/Program Files/MysqL2/MysqL Server 5.1/"
  44. #Path to the database root
  45. datadir="C:/ProgramData/MysqL2/MysqL Server 5.1/Data/"
  46. #
  47. # The default character set that will be used when a new schema or table is
  48. # created and no character set is defined
  49. default-character-set=latin1
  50. # The default storage engine that will be used when create new tables when
  51. default-storage-engine=INNODB
  52. # Set the sql mode to strict
  53. sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
最佳答案
根据您的服务器/操作系统,安装过程略有不同.

对于Linux,您可能会发现它很有用-http://code.openark.org/blog/mysql/manually-installing-multiple-mysql-instances-on-linux-howto

搜索它,您可能还会找到其他人.

猜你在找的MySQL相关文章