MySQL Forums
Forum List  »  Install & Repo

Re: Error no. 2013 Lost connection to MySQL server during query
Posted by: Chris Notdisclosed
Date: March 17, 2005 10:56PM

I might have a little extra info.

In my case, we have mySQL 4.1.10 on Windows 2003 Server Edition. I use mySQL Control Centre and mySQL Administrator graphical interfaces.

We recently powered down the server to move it to a new location. I found out after the fact that I had removed the "my.ini" file from C:\Windows. This was the only instance of this file on this machine.

The innodb_data_home_dir= directive in the my.ini file was assigned to point to a location on a different hard drive. As a result, the file "ibdata1" was being stored there, but the files "ib_logfile0" and "ib_logfile1" were being stored in the mySQL installation's data directory (C:\Program Files\MySQL\MySQL Server 4.1\data).

mySQL did not recover when the power came on. The .err file (in the data directory) reported a normal shutdown thus:

050318 11:46:42 [Note] C:\Program Files\MySQL\MySQL Server 4.1\bin\mysqld-max-nt: Normal shutdown
050318 11:46:42 InnoDB: Starting shutdown...
050318 11:46:46 InnoDB: Shutdown completed; log sequence number 0 1257430
050318 11:46:46 [Note] C:\Program Files\MySQL\MySQL Server 4.1\bin\mysqld-max-nt: Shutdown complete

but the reboot began with this:

InnoDB: The first specified data file .\ibdata1 did not exist:
InnoDB: a new database to be created!
050318 12:09:41 InnoDB: Setting file .\ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Error: log file .\ib_logfile0 is of different size 0 63963136 bytes
InnoDB: than specified in the .cnf file 0 5242880 bytes!
050318 12:09:42 [ERROR] Can't init databases
050318 12:09:42 [ERROR] Aborting

I could not find a ".cnf" file anywhere on the machine, and the mySQL manual said it loads it "if it exists". (Trying to create a .cnf file on Windows 2003 SE resulted in a "speed dial" file !?)

I tried a variety of combinations of deleting the ibdata1 file, the ib_logfile0 and ib_logfile1 files and the ".frm" files in our database's subdirectory (\data\intranet\). The best I could acheive was to restart the service but with an empty intranet database.

An online posting suggested that if you had data you might lose, then the solution was to rewrite the .cnf file with the correct logfile size. As I had no ".cnf" file, a quick look at the local help (mysql --verbose --help) showed I could start mySQL and specify the logfile size thus:

mysqld --innodb_log_file_size=nnnnn

The service started - and I *could* browse the intranet database's tables and data using mySQL Control Centre.

I jumped over to Windows' Services control panel and found the mySQL service was not running. Once I started it, mySQL Control Centre would then report the error in this thread:

[localhost] ERROR 2013: Lost connection to MySQL server during query

This is mildly annoying - as I know the data is there, I know the structure is there, but I can't *use* it.

Thanks to the earlier posters who said reinstalling mySQL wouldn't help - you have saved me alot of headache (serious!).

Chris.

Options: ReplyQuote


Subject
Written By
Posted
Re: Error no. 2013 Lost connection to MySQL server during query
March 17, 2005 10:56PM


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.