Solved

How to Upgrade MySQL on Windows Server 2003 from MySQL 5.1 to 5.5

Posted on 2011-10-01
6
748 Views
Last Modified: 2012-06-21
I'm struggling with understanding the proper steps to upgrade MySQL 5.1.41 to the latest MySQL version, which is 5.5.16.  This is on a server that is running Windows Server 2003.  I have made two attempts so far, but am not successful yet.  

I have been following what is shown in the MySQL documentation at these links:
http://dev.mysql.com/doc/refman/5.5/en/upgrading-from-previous-series.html
http://dev.mysql.com/doc/refman/5.5/en/upgrading.html
http://dev.mysql.com/doc/refman/5.5/en/windows-upgrading.html
http://dev.mysql.com/doc/refman/5.5/en/backup-policy.html
http://dev.mysql.com/doc/refman/5.5/en/windows-start-service.html

The biggest issue for me, is that this is on a production server (there is no dev server to try this on first), so I need to keep the current MySQL intact in case this fails again.  I must be able to go back to the 5.1 MySQL, if needed.

The closest I've come, is as follows:
I ran a complete dump of the current MySQL database by using this command (not even sure if this is the proper command):
mysqldump --user=root --password --single-transaction --flush-logs --all-databases  > file.sql

 I downloaded the zip version (win32) of MySQL 5.5.16 and extracted it.  I stopped & disabled the service for the current MySQL.  I created a new servive (with a different service name than the original, though I did not delete the original service) using the instructions in one of the links above.  I was able to start the service, and connect to it on localhost via mysql workbench.  This all seemed to work.  I had a practically empty server at this point, of course, as my data was not there yet.  I'm not really clear on the proper way to move (or re-point) to my existing databases.  I tried using workbench to restore the sql dump I'd done earlier.  It ran for awhile, but then errored with "MySQL has stopped working".  Sure enough, it was no longer running for some reason.  I manually tried to restart the service, but it would not start.  I assume that my import of the dump alter the data in the system tables, which caused this issue, but I'm only guessing.

If anyone has been through this process before, if you could offer me very clear step-by-step instructions on how to do this upgrade, I would be immensely grateful.  Especially clearly explaining how I need to get the new version to see my existing databases.  I have a mixture of InnoDB and MyISAM, plus memory (system stuff), so all types of formats need to be working.

Thanks so much.
0
Comment
Question by:sah18
  • 3
  • 3
6 Comments
 
LVL 24

Expert Comment

by:johanntagle
ID: 36897877
Look for the MySQL error log file and also the system error log file (not sure the equivalent of this in Windows) and see what error message you get when you try to start the database.  Work from there.
0
 
LVL 9

Author Comment

by:sah18
ID: 36898025
What is the proper way to move over the database files?
0
 
LVL 24

Expert Comment

by:johanntagle
ID: 36898191
Option 1:

1.  Shutdown mysql
2.  copy the full /var/lib/mysql directory
3.  Restart mysql

Option 2:

1.  Turn off slave and execute "flush tables with read lock"
2.  Create an LVM snapshot of the partition where /var/lib/mysql resides
3.  Execute "unlock tables" and reenable slave
4.  Mount the snapshot and copy the equivalent var/lib/mysql subdirectory to your backup directory
5.  unmount and delete snapshot

Option 2 has the advantage of not having to shutdown mysql and the slave for a long time.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 9

Author Comment

by:sah18
ID: 36903210
My question is for MySQL on Windows (not Linux).
0
 
LVL 9

Author Comment

by:sah18
ID: 36903217
Can someone who has working with MySQL upgrades on Windows assist me?
0
 
LVL 24

Accepted Solution

by:
johanntagle earned 500 total points
ID: 36903493
Option 1 above should still be valid except replace the directory path with the datadir defined in your my.cnf.  Backup that directory, then proceed with mysql upgrade.  Again if you encounter problems, look for your mysql error log file.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I have been using r1soft Continuous Data Protection (http://www.r1soft.com/linux-cdp/) for many years now with the mySQL Addon and wanted to share a trick I have used several times. For those of us that don't have the luxury of using all transact…
Creating and Managing Databases with phpMyAdmin in cPanel.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now