문제

같은 컴퓨터의 두 개의 다른 포트에서 MySQL 서버를 사용하고 싶습니다. 두 개의 별도 구성 파일을 만들었습니다. 내가 정의한 두 번째 포트에서 MySQL 서버에 연결하려고 할 때 연결할 수 없습니다. MySQL을 실행하는 OS는 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

Google과 다른 사람들도 찾을 수 있습니다.

다른 팁

mysql_multi를 사용하는 것이 좋습니다 http://www.pythian.com/blog/using-mysqld_multi-to-manage-multiple-servers/

구성 사본은 더러운 해킹 IMHO입니다

다른 것을 지정해야합니다 datadir (즉, 데이터베이스 파일을 포함하는 디렉토리) 명령 줄에. 서로를 잠그거나 데이터 부패를 일으키기 때문에 다른 인스턴스에서 동일한 데이터베이스를 열 수 없습니다.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top