Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Urgent: covert MySQL 4.0.x dump for import to MySQL 5.1.x

Posted on 2006-05-07
10
Medium Priority
?
476 Views
Last Modified: 2012-05-05
I need to import my most recent backups from a MySQL 4.0.x database to a MySQL 5.1.x.

Backups were created via cPanel, which gives a GZipped MySQLDump
Trying to import with the latest PHPMyAdmin - but I'm getting errors due to the way table definitions are now dealt with differently.

Please post scripts, links to scripts or hints as to how I convert it quickly.
0
Comment
Question by:CraigHarris
  • 5
  • 2
  • 2
9 Comments
 
LVL 16

Expert Comment

by:ellandrd
ID: 16626597
what platform? windows or *nix?
0
 
LVL 16

Assisted Solution

by:ellandrd
ellandrd earned 200 total points
ID: 16626615
0
 
LVL 7

Author Comment

by:CraigHarris
ID: 16626776
Moved from Linux to Windows, so anything I use must run on Windows 2003

Checking out the links ...
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
LVL 7

Author Comment

by:CraigHarris
ID: 16626787
MySQL 5 is installed fine on new server and works perfect with all databases on there - but I have 3 databases which were dumped to GZipped SQL from MySQL 4.0 and I need to import them -- however, due to differences in 5.0, the SQL which was dumped from 4.0 is not valid SQL on MySQL 5.0 :(

I know how to do the import, I just need a script which will make required alterations to the SQL before I import it.
0
 
LVL 9

Accepted Solution

by:
pradapkumar earned 800 total points
ID: 16630859
BACKUP TABLE employees TO 'c:/temp/mysql4'

The above sql command will backup your employee table to the folder c:\temp\mysql4.
this is for your idea only.
You can change your folder name accordingly to your linux os.
this may look like

mysql> BACKUP TABLE employees TO '/usr/temp/mysql4';

then copy the content of mysql4 data to your new windows server in to a folder.

now create your database using the command like

mysql> CREATE DATABASE company;
mysql> USE company;

then you can restore your table using

mysql> RESTORE TABLE employee FROM 'c:/temp/mysql4';

you has to write the above code for your each and every table.
If you have morethan one database then save the tables in seperate folders and restore it in the same order.
Thats all.
0
 
LVL 7

Author Comment

by:CraigHarris
ID: 16631282
Just 1 problem: I no longer have the Linux server I have the backups from!
0
 
LVL 9

Expert Comment

by:pradapkumar
ID: 16636441
No other go. Just find a machine with mysql 4.0 and import data and use the above suggestion. Or simply copy the database folders from mysql data folder.
It will works fine with the latest production release of mysql5.0
0
 
LVL 7

Author Comment

by:CraigHarris
ID: 16641730
I'll try installing MySQL 4 on a spare rig, and see what happens - thanks for suggestions.
0
 
LVL 7

Author Comment

by:CraigHarris
ID: 16805302
To get arround this issue, I ended up installing MySQL 4 on a spare rig, exporting using phpMyAdmin, then importing into MySQL 5.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

572 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