0

I have a backup dump from an old Mysql installation created through MySQL Administrator dump 1.4 , Server version 5.0.22-community-nt.

From this dump a need to move a particular database (let's call it "olddatabase") to my Mysql 5.5 installation.

I tried to import it creating a database named "olddatabase" on my installation and executing the command:

mysqldump -u root -p olddatabase < c:\olddump.sql

but the database is not populated with data, even if mysqldump ends correctly ("Dump completed on...").

I also tried to execute mysql_upgrade, but nothing changed.

I installed Mysql 5.0 on a virtual machine, imported the dump correctly, then I exported the "olddatabase" database throught PhpMyAdmin (4.0.10), and tried to import it throught PhpMyAdmin (4.2.11) on my computer.

I get the following error:

ALTER TABLE `mytable`
ADD CONSTRAINT `Mytable_AcquisitionTime` FOREIGN KEY (`acquisitionTime`) REFERENCES `timespans` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `Mytable_CopyOf` FOREIGN KEY (`id`) REFERENCES `mytable` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `Mytable_SubtypeOf` FOREIGN KEY (`id`) REFERENCES `info` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION;

#1025 - Error on rename of '.\olddatabase\#sql-87c_63' to '.\olddatabase\mytable' (errno: 150)  

Any idea why I can't import the database from the dump, or why I get this error?

  • 1
    Looks like this has already been answered here http://stackoverflow.com/questions/4061293/mysql-cant-create-table-errno-150 – Ben Yee Nov 18 '14 at 16:30
  • 1
    Here's the same question: http://stackoverflow.com/questions/4080611/1025-error-on-rename-of-database-sql-2e0f-1254ba7-to-database-table (check the constraints) – Gerardo Charles Rojas Vega Nov 18 '14 at 16:32
  • The issue come from a "recursive call" on constrants. In some places of the sql file there are constrains like: ALTER TABLE `table1` ADD CONSTRAINT `Table1_Specialize` FOREIGN KEY (`id`) REFERENCES `table1` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; It is not clear to me why MySQL accepts this code and Mysql 5.5 doesn't accecpt it. – Antonio Giovanni Schiavone Nov 25 '14 at 19:06

0 Answers0