Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Upgrading mysql won't start due [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
dageyra
Apprentice
Apprentice


Joined: 22 Feb 2005
Posts: 186
Location: Terre Haute, IN

PostPosted: Mon Apr 30, 2012 2:58 am    Post subject: Upgrading mysql won't start due [SOLVED] Reply with quote

I am upgrading mysql from 4.1 to the latest version 5.5 I believe. Everything has gone smoothly except that after the upgrade I can't get mysql to start.

Here is a snippet from the log:

Code:

120429 23:10:02 [Warning] './mysql/host' had no or invalid character set, and default character set is multi-byte, so character column sizes may have changed
120429 23:10:02 [ERROR] Fatal error: Can't open and lock privilege tables: Incorrect key file for table 'host'; try to repair it


Any idea what is stopping mysql from starting? I know that mysql_upgrade is supposed to be run but it requires a valid mysql connection, which I can't get without mysql starting! So it creates a catch-22. I did try to run mysql_upgrade after the new mysql was emerged but it threw errors, which I thought were related to needed to restart the service.

Thanks for any suggestions you can provide to get past this error.


Last edited by dageyra on Thu May 10, 2012 8:02 pm; edited 1 time in total
Back to top
View user's profile Send private message
Mad Merlin
Veteran
Veteran


Joined: 09 May 2005
Posts: 1134

PostPosted: Tue May 01, 2012 2:37 am    Post subject: Reply with quote

That's a biiiiiiig version jump, you skipped over 5.0, 5.1, 5.4 and went straight to 5.5. The farther you jump here, the bigger the chances of something bad happening, I believe only 1 major version at a time is supported.

Now, assuming you did a clean shutdown of the old 4.1 install and the data on disk is actually OK, I would suggest doing a full mysqldump (--all-databases) with the old version and then importing it with the new version and then running mysql_upgrade. This is your most reliable bet and the best chance for having your data 100% correct when you restore.

Edit: If for whatever reason that's not an option, you can use the myisamchk tool directly on the tables without having the daemon started.
_________________
Game! - Where the stick is mightier than the sword!
Back to top
View user's profile Send private message
dageyra
Apprentice
Apprentice


Joined: 22 Feb 2005
Posts: 186
Location: Terre Haute, IN

PostPosted: Tue May 01, 2012 3:35 am    Post subject: Reply with quote

Mad Merlin wrote:
That's a biiiiiiig version jump, you skipped over 5.0, 5.1, 5.4 and went straight to 5.5. The farther you jump here, the bigger the chances of something bad happening, I believe only 1 major version at a time is supported.

Now, assuming you did a clean shutdown of the old 4.1 install and the data on disk is actually OK, I would suggest doing a full mysqldump (--all-databases) with the old version and then importing it with the new version and then running mysql_upgrade. This is your most reliable bet and the best chance for having your data 100% correct when you restore.

Edit: If for whatever reason that's not an option, you can use the myisamchk tool directly on the tables without having the daemon started.


Thanks for the reply. Some interesting developments, the data is fine. The server performed daily backups and I did do a full dump prior to starting this. However, we have 5.5 running on another server (mail server actually, where we were testing database compatibility). Moving the data files over, everything is accessible. I actually was able to setup the users with remote access, and now all the services are functioning normally (except those that we knew were incompatible, not core services). So that tells me the data is fine and actually it makes fixing this issue on the main server as more of an exercise for me.

So you're suggesting basically what I did with the mail server, to do a clean install on the web server and then import the data accordingly? The "host" error whatever it is won't be a problem with a clean install?
Back to top
View user's profile Send private message
Mad Merlin
Veteran
Veteran


Joined: 09 May 2005
Posts: 1134

PostPosted: Tue May 01, 2012 9:53 pm    Post subject: Reply with quote

dageyra wrote:
Mad Merlin wrote:
That's a biiiiiiig version jump, you skipped over 5.0, 5.1, 5.4 and went straight to 5.5. The farther you jump here, the bigger the chances of something bad happening, I believe only 1 major version at a time is supported.

Now, assuming you did a clean shutdown of the old 4.1 install and the data on disk is actually OK, I would suggest doing a full mysqldump (--all-databases) with the old version and then importing it with the new version and then running mysql_upgrade. This is your most reliable bet and the best chance for having your data 100% correct when you restore.

Edit: If for whatever reason that's not an option, you can use the myisamchk tool directly on the tables without having the daemon started.


Thanks for the reply. Some interesting developments, the data is fine. The server performed daily backups and I did do a full dump prior to starting this. However, we have 5.5 running on another server (mail server actually, where we were testing database compatibility). Moving the data files over, everything is accessible. I actually was able to setup the users with remote access, and now all the services are functioning normally (except those that we knew were incompatible, not core services). So that tells me the data is fine and actually it makes fixing this issue on the main server as more of an exercise for me.

So you're suggesting basically what I did with the mail server, to do a clean install on the web server and then import the data accordingly? The "host" error whatever it is won't be a problem with a clean install?


Basically, yes. The data formats change over time and I would be surprised if there's any serious testing done of 5.5 reading 4.1 data files. On the other hand, the database dumps are meant to be portable, so they should work just fine for moving your data around versions.
_________________
Game! - Where the stick is mightier than the sword!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum