I need to upgrade mysql 5.0 to mysql 5.1 and mysql-connector 5.1.16, how to do this one?
What are the steps I should follow?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.
Sign up to join this communityupgrading from mysql server 5.0 to 5.1
The method in here was the way that this website upgraded MySQL from 5.0 to 5.1. This method could not be same as in your situation. So, first of all, follow the MySQL's guideline (documentation) to upgrade your MySQL engine. This thread is just for the informational purpose only.
Upgrade Steps:
Backup your database (directory backup would be enough) and MySQL Datafiles (make the copy of it). For example, you may just keep the "c:\program files\MySQL\MySQL Server 5.0" directory as it is. But, when you install the MySQL 5.1, be sure that it's installed in different directory like "c:\program files\MySQL\MySQL Server 5.1".
Before start, run the command mysql_upgrade (Check Tables for MySQL Upgrade)
After upgrading a 5.0 installation to 5.0.10 or above, it is necessary to upgrade your grant tables. Otherwise, creating stored procedures and functions might not work.
mysql_upgrade should be executed each time you upgrade MySQL. It checks all tables in all databases for incompatibilities with the current version of MySQL Server. If a table is found to have a possible incompatibility, it is checked. If any problems are found, the table is repaired. mysql_upgrade also upgrades the system tables so that you can take advantage of new privileges or capabilities that might have been added.
To check and repair tables and to upgrade the system tables, mysql_upgrade executes the following commands:
mysqlcheck --check-upgrade --all-databases --auto-repair mysql_fix_privilege_tables
mysql_upgrade reads options from the command line and from the [mysql_upgrade] group in option files. It supports the options in the following list. Other options are passed to mysqlcheck and to mysql_fix_privilege_tables. For example, it might be necessary to specify the --password[=password] option.
Stop the MySQL service. Run the command "net stop MySQL" from the DOS command line
Remove the MySQL service Run the command "mysqld-nt --remove". mysqld-nt command could be different based on your runtime environment.
Start the MySQL 5.1 installation. I recommand you to download mysql-5.1.xx-win32.zip and unzip it. It will create the setup.exe file. When you run the setup.exe file, be sure that where the data directory is created. By default, system tries to install it at "C:\Documents and Settings\All Users\Application Data\MySQL\MySQL Server 5.1\data". But I do not recommend this location, instead, use the similiar place where the data directory created in MySQL 5.0 something like "C:\Program Files\MySQL\MySQL Server 5.1\data".
Once you finish above tasks, bring out the my.ini configuration file to notepad or any word editor from your current installation directory and backup directory and carefully compare those. If any modification is required, make the changes on the my.ini file as you like.
Now you successfully created new MySQL service and started it using the installation wizard. If the service is not registered or started, use the command: mysqld --install net start MySQL
One interesting thing is, MySQL 5.1 version does not have the many different MySQL daemons. It only had mysqld (improved from previous version).
The next step is launching old database using any tools you like. Before you launch the old database, you need to copy your database directory from your old MySQL 5.0 to MySQL 5.1 data directory. To launch the old database in MySQL 5.1, I used "Navicat for MySQL" database tool. For the information how to use the Navicat tool, please refer other documentation. Explaining how to use Navicat is not the purpose of this thread.
Run the command mysql_upgrade again to validate the upgrade.
Now you finished the upgrading MySQL to version 5.1.x.