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?

5
  • which System Error code do you get? Commented May 31, 2011 at 15:51
  • This one: 111. I did a mysqld_multi restart, that worked, but I couldn't find my own tables :(. Where are they? Commented May 31, 2011 at 15:52
  • I'm getting a headache, when I try the following in SSH, I get an error that it doesn't work, but it does in PHP??? root@vps8202:~# mysql -h 127.0.0.1 -p 3307 -u root Enter password: ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' Commented May 31, 2011 at 16:01
  • -p is for password -P is for port. Try mysql -h 127.0.0.1 -p -P 3307 Commented May 31, 2011 at 16:14
  • Thanx, when I do SHOW DATABASES, it doesn't show the ones I created. (just mysql, phpmyadmin, information_schema and test). Where are my (old) databases? How can I find them? Commented May 31, 2011 at 16:16

1 Answer 1

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.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.