MySQL Forums
Forum List  »  Install & Repo

Re: Error no. 2013 Lost connection to MySQL server during query
Posted by: Chris Notdisclosed
Date: March 20, 2005 06:09PM

After posting the last message, the "fix" became obvious - I think the last message contained all the info you need (or at least, everything that I needed) to get access to mySQL from the commandline.

Using mysqldump I was able to dump the current copy of the database that I did not want to lose:

(from the command line:)
mysqldump -u root -p databasename > filename.sql

Then I connected to the database server and dropped the database, then created a new (empty) one:

mysql -u root -p
drop database databasename;
create database databasename;
exit

Then exit the server (as above) and populate the new data with the file you created:

mysql -u root -p databasename < filename.sql

The reason this worked was because the corruption seemed to occur in the InnoDB data, not in the "data data" (the end-user's data).

At any rate, I was then able to connect to the new copy of the database using all GUI clients, PHP, whatever.

For me, the point of the exercise was to learn what went wrong and how to recover without loss - we would only have lost the morning's work as we had a backup from the night before, but hey - now I can post at least one solution that worked for one person.

Good luck people.

Chris.

Options: ReplyQuote


Subject
Written By
Posted
Re: Error no. 2013 Lost connection to MySQL server during query
March 20, 2005 06:09PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.