在mysql中运行多个mysql实例

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

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

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

# CLIENT SECTION
# ----------------------------------------------------------------------
#
# The following options will be read by MysqL client applications.
# Note that only client applications shipped by MysqL are guaranteed
# to read this section. If you want your own MysqL client program to
# honor these values,you need to specify it as an option during the
# MysqL client library initialization.
#
[client]

port=3306

[MysqL]
MysqL-path="C:\Program Files\MysqL\MysqL Server 5.1\bin"
default-character-set=latin1

[client]

port=3307

[MysqL1]
MysqL1-path="C:\Program Files\MysqL2\MysqL Server 5.1\bin"
default-character-set=latin1

# SERVER SECTION
# ----------------------------------------------------------------------
#
# The following options will be read by the MysqL Server. Make sure that
# you have installed the server correctly (see above) so it reads this 
# file.
#
[MysqLd]
MysqLd-path="C:\Program Files\MysqL\MysqL Server 5.1\bin\"

# The TCP/IP Port the MysqL Server will listen on
port=3306

#Path to installation directory. All paths are usually resolved relative to this.
basedir="C:/Program Files/MysqL/MysqL Server 5.1/"

#Path to the database root
datadir="C:/ProgramData/MysqL/MysqL Server 5.1/Data/"
#
server_id=1

[MysqLd1]
# The TCP/IP Port the MysqL Server will listen on
port=3307
server_id=2
MysqLd1-path="C:\Program Files\MysqL2\MysqL Server 5.1\bin\"

#Path to installation directory. All paths are usually resolved relative to this.
basedir="C:/Program Files/MysqL2/MysqL Server 5.1/"

#Path to the database root
datadir="C:/ProgramData/MysqL2/MysqL Server 5.1/Data/"
#
# The default character set that will be used when a new schema or table is
# created and no character set is defined
default-character-set=latin1

# The default storage engine that will be used when create new tables when
default-storage-engine=INNODB

# Set the sql mode to strict
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

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

原文链接:https://www.f2er.com/mysql/531980.html

猜你在找的MySQL相关文章