Knowledgebase

how can i import .sql form mysql 4.1 to 4.0 ?

Posted by joelin, 08-30-2007, 03:14 AM
hi, i am not sure if this is the right sub-forum to post the question. it is that i my a forum running with php and mysql, the version of it is 4.1 now, i wnat to move the forum to another server, but the mysql version of the server is 4.0, i try to backup the .sql form phpmyadmin and import form phpmyadmin,too. but it failed, some article tell me that i should change some setting in the .sql file, but i try and failed, can anyone teach me how can i process it? thanks a lot.

Posted by macooper, 08-30-2007, 08:07 AM
This is working from memory as it's a long time ago that I last moved a database from 4.1 to 4.0. But you need to edit the file with a text editor. When you export table definitions from mysql 4.1, it includes information on the character set used, so your tables will appear something like this note that the exact details of the syntax and the character set used will likely be differant for your database. What you need to do is remove the character set information from the table definitions so you end up with this Use the search and replace function (carefully) of your text editor to remove that data. When you have finished, save it as a new filename and run that through phpmyadmin. Saving as a seperate file and preserving your original copy is just a safety precaution. All this change does is makes mysql use the default character set when you restore the database, which works fine in mysql 4.0. It won't affect your data (unless you have non ascii data in the tables). HTH

Posted by foobic, 08-30-2007, 08:14 AM
Don't mess with the sql file, make a new database backup in 4.0-compatible mode. From shell: in phpMyAdmin you should find a checkbox for it somewhere on the backup page.

Posted by WebScHoLaR, 08-30-2007, 08:15 AM
If you have the SSH access then you can generate the MySQL4.0 compatible dump on MySQL4.1 server as: PhpMyAdmin also has such an option to specify the compatible mysql version while generating the dump. This will generate the dump that can be easily imported on the server running MySQL 4.0.

Posted by david510, 08-31-2007, 05:37 AM
Editing sql file is not recommended, as it can cause issues . Use the method foobic stated.

Posted by whmcsguru, 08-31-2007, 03:47 PM
Upgrade SQL, don't downgrade your script. Mysql is in the 5.1 area now (beta), and php5 (which you'll need to upgrade to shortly) requires mysql >= 4.1. Solution? Upgrade mysql to the current version, don't downgrade a script to an old, outdated one.



Was this answer helpful?

Add to Favourites Add to Favourites

Print this Article Print this Article

Also Read
Help needed (Views: 532)
Hostlatte - avoid! (Views: 621)


Language:

Client Login

Email

Password

Remember Me

Search