Pregunta

Quiero usar el servidor MySQL en dos puertos diferentes en la misma máquina. He hecho dos ficheros de configuración independientes. Cuando estoy tratando de conectar con el servidor MySQL en el segundo puerto he definido, entonces no puedo conectar. El sistema operativo ejecutar MySQL es Windows Vista. También traté de iniciar mysqld desde la línea de comandos después de especificar el puerto.

Este es el archivo de ejemplo que he cambiado para el servidor MySQL para leer a partir de dos puertos diferentes:

# 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"
¿Fue útil?

Solución

El procedimiento de instalación varía ligeramente en función de su sistema de servidor / operativo.

En Linux es posible encontrar esto útil - http://code.openark.org/blog/mysql/manually-installing-multiple-mysql-instances-on-linux-howto

Google y usted podría encontrar para otros también.

Otros consejos

mejor utilizar mysql_multi http: //www.pythian .com / blog / uso-mysqld_multi de gestionar múltiples servidores--/

copias de configuraciones están sucios en mi humilde opinión truco

Es necesario especificar también un datadir diferente (es decir, el directorio que contiene los archivos de base de datos) en la línea de comandos. No se pueden abrir las mismas bases de datos en diferentes instancias, ya que cerraba entre sí y / o provocar la corrupción de datos.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top