加入收藏 | 设为首页 | 会员中心 | 我要投稿 济源站长网 (https://www.0391zz.cn/)- 数据工具、数据仓库、行业智能、CDN、运营!
当前位置: 首页 > 站长学院 > MySql教程 > 正文

在mysql中运行多个mysql实例

发布时间:2021-01-18 22:53:39 所属栏目:MySql教程 来源:网络整理
导读:我想在同一台计算机的两个不同端口上使用MySQL服务器.我做了两个单独的配置文件.当我尝试在定义的第二个端口上连接到MySQL服务器时,则无法连接.运行MySQL的操作系统是Windows Vista.指定端口后,我还尝试从命令行启动mysqld. 这是我已更改的示例文件,供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 FilesMySQLMySQL Server 5.1bin"
default-character-set=latin1

[client]

port=3307

[mysql1]
mysql1-path="C:Program FilesMySQL2MySQL Server 5.1bin"
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 FilesMySQLMySQL Server 5.1bin"

# 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 FilesMySQL2MySQL Server 5.1bin"

#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

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

(编辑:济源站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    热点阅读