Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 07-25-2006, 10:33 PM   #1
Senior Member
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Rep: Reputation: 51
SQL: old sql dump not loading into new db

My local webserver died so I rebuilt it. The production webserver I'm using runs Mysql 3.23. My local server runs 5.0. If I take my dumped sql db from the webserver & try to load it on the local server, I get:

mysql db < Fri.db-backup.sql
ERROR 1060 (42S21) at line 97350: Duplicate column name 'address_types_id'

the area in question looks like:
# head -n 97355 Fri.db-backup.sql | tail -n 10
-- Table structure for table 'address_types'

CREATE TABLE address_types (
  address_types_id int(4) NOT NULL auto_increment,
  address_types_description varchar(25) default NULL,
  address_types_abrv char(3) default NULL,
  PRIMARY KEY  (address_types_id,address_types_id)
any idea how I can fix this?
Old 07-26-2006, 12:55 AM   #2
LQ Guru
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
As I have not worked with many versions of MySQL, and my knowledge is limited, I'd try a small trick: create a test database with the MySQL version you're trying to load the database into (the "problematic one"). Then see how the PRIMARY KEY section is written there, since that seems to be the problem in your case (address_types_id is twice there). If the new version only produces the key once and not twice (for example), alter your .sql file accordingly and re-try (remember to back-up the file so you can revert the changes if needed).


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Migrating from MS-SQL server to My-SQL emailssent Linux - Networking 2 02-07-2005 03:20 PM
Massive SQL dump without local access. xconspirisist Linux - General 1 01-30-2005 11:07 AM
Which SQL is suitable for EMbedded SQL on C? hk_michael Programming 4 01-10-2005 06:07 PM
How do I get a dump file (.sql) into MySql? TreeDragon60 Linux - Software 4 03-21-2004 06:19 AM
Loading sql dumpfile into mySQL patpawlowski Programming 2 01-24-2004 09:01 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:49 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration