Pergunta

Eu quero usar o servidor MySQL em duas portas diferentes na mesma máquina. Eu fiz dois arquivos de configuração separados. Quando eu estou tentando se conectar ao servidor MySQL na segunda porta I definido, então eu não pode se conectar. O sistema operacional executando o MySQL é o Windows Vista. Eu também tentou iniciar mysqld de linha de comando depois de especificar a porta.

Este é o arquivo de amostra eu mudei para o servidor MySQL para ler a partir de duas portas 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"
Foi útil?

Solução

Os difere procedimento de instalação ligeiramente com base no seu sistema de servidor / funcionamento.

Para linux você pode encontrar este útil - http://code.openark.org/blog/mysql/manually-installing-multiple-mysql-instances-on-linux-howto

O Google-lo e que você pode encontrar para os outros também.

Outras dicas

melhor usar mysql_multi http: //www.pythian .com / blog / utilizando-mysqld_multi de gerenciar-vários servidores /

cópias de configurações estão sujos corte imho

Você precisa também especificar um datadir diferente (ou seja, o diretório que contém os arquivos de banco de dados) na linha de comando. Você não pode abrir os mesmos bancos de dados em diferentes instâncias, como eles iriam bloquear uns aos outros e / ou causa dados corrupção.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top