質問

同じマシン上の 2 つの異なるポートで MySQL サーバーを使用したいと考えています。2 つの別々の設定ファイルを作成しました。定義した 2 番目のポートで MySQL サーバーに接続しようとすると、接続できません。MySQL を実行する OS は Windows Vista です。私も始めてみました mysqld ポートを指定した後、コマンドラインから。

これは、MySQL サーバーが 2 つの異なるポートから読み取るように変更したサンプル ファイルです。

# 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 /ブログ/使用-mysqld_multiに管理 - 複数のサーバ/

のconfigsのコピーが汚いハックの私見です。

また、コマンドライン上で異なるdatadir(データベースファイルが含まれている、すなわちディレクトリ)を指定する必要があります。彼らはお互いをロックおよび/またはデータ破損を引き起こすとしてあなたは、異なるインスタンスで同じデータベースを開くことができません。

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top