0

I had two MySQL servers running (127.0.0.1:3306 and 127.0.0.1:3307). Now I get this strange error: mysql_connect(): Lost connection to MySQL server at 'reading initial communication packet' I can connect with localhost:3307, but there aren't any tables/databases. I'm sure /etc/my.cnf is right:

[mysqld_multi]
mysqld     = /usr/bin/mysqld_safe
mysqladmin = /usr/bin/mysqladmin
user       = root
password   = ***

[mysqld]
port       = 3306
socket   = /var/run/mysql/mysql.sock

[mysqld2]
port       = 3307
socket   = /var/run/mysql/mysql2.sock

What can I do now? How can I restart the MySQL server? How can I make sure all tables still exists?

John Gardeniers
  • 27,458
  • 12
  • 55
  • 109

1 Answers1

0

You didn't specify the datadir for each of your mysqld instances. E.g.:

[mysqld]
port = 3306
socket = /var/run/mysql/mysql.sock
datadir = /var/lib/mysql

Your question is a few months old, I sure hope you figured it out.

titania424
  • 116
  • 1