Link to home
Start Free TrialLog in
Avatar of stuartc1
stuartc1

asked on

Downgrade MySQL Data from V5 to V3

Hello,

The answer to this must be easy, but Im not having any luck finding it.

I need to extract a database from MySQL 5.0 using mysqldump command - then laod this dump into  MySQL 3.2.3.

The problem is I get some commands at the top of the dump which MySQL3 cannot understand. These are somrthing like:


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;



I need to find a option to use which will stop mysqldump from creating this data.

So far I have tried:

--skip-opt
--skip-comments
--compatible=mysql323
--skip-triggers

Although the above does reduce some extra info I dont need, it does not remove the section I mentioned above.


Any ideas on how to do a very absoluted basic dump?

I only need to DROP IF EXISTS/CREATE/INSERT

Thanks
Avatar of stuartc1
stuartc1

ASKER

Forget it..... I have the answer.

mysqldump -uroot --compact --compatible=mysql323 --add-drop-table mydb > dump.sql

The order is important as is the --compact flag!!

Please Close this, thanks.
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial