Home > Database > Mysql Tutorial > Windows下MySQL多实例运行_MySQL

Windows下MySQL多实例运行_MySQL

WBOY
Release: 2016-06-01 13:29:05
Original
1035 people have browsed it

bitsCN.com

Windows下MySQL多实例运行

 

1.正常安装Windows版的MySQL,例如安装在d:/MySQL文件夹里; 

2.按照常规配置好MySQL; 

3.复制备份安装好的文件夹,命名为“MySQL_3307"; 删除 data目录下的文件其他文件夹,只剩 test和mysql文件夹;

4.修改“d:/MySQL_3307" 下的my.ini 端口为3307

Java代码  

[client]  

port=3307  

[mysqld]  

# The TCP/IP Port the MySQL Server will listen on  

port=3307  

 

程序路径改为 d:/MySQL_3307

 

Java代码  

[mysqld]   

# The TCP/IP Port the MySQL Server will listen on   

port=3307   

#Path to installation directory. All paths are usually resolved relative to this.   

basedir="d:/MySQL_3307"   

#Path to the database root   

datadir="d:/MySQL_3307/Data/"   

 

5.在cmd命令行模式下,进入第2个MySQL_3307的/bin文件夹。 

执行mysqld install MySQL_3307命令。作用是为Mysql安装一个服务,服务名是MySQL_3307,

6.完毕后,在运行里运行REGEDIT,打开WINDOWS注册表编辑器,

在HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/MySQL_3307打开,

修改下面的ImagePath数值: "D:/MySQL_3307/bin/mysqld" --defaults-file="D:/MySQL_3307/my.ini" MySQL_3307

确定,退出注册表编辑器。

7.然后就可以在服务管理里正常启动MySQL_3307服务。

 

注:若想重命名mysql服务名称,

1.进入services.msc关闭MySQL服务

2.C:/>sc delete MySQL “MySQL”为服务名称

3.重复上面的第6、7步即可

删除服务后,进入到注册表里,看旧的mysql节点是否删除。

 

bitsCN.com
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template