LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-05-2008, 07:36 PM   #1
RAH104
Member
 
Registered: Jun 2008
Posts: 33

Rep: Reputation: 15
Question Restore Database


Hello,

I am currently attempting to restore a very large MySQL database (1.4GB).

[root@server]# mysql --password=xxx --user=root vb < backup.sql
ERROR 1060 (42S21) at line 5116: Duplicate column name 'quoteid'

Is there anyway of forcing the database to restore? Basically it takes like an hour to get to this error where it halts and doesn't restore the rest of the database.

Thanks.
 
Old 07-05-2008, 08:26 PM   #2
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
No, as you can't have two columns with the same name in the same table. I would look at the file and see why two columns of the same name are being created. How was the backup created? Exact same version of MySQL?
 
Old 07-05-2008, 08:40 PM   #3
RAH104
Member
 
Registered: Jun 2008
Posts: 33

Original Poster
Rep: Reputation: 15
Both servers are running MySQL 5. Backup was made with mysqldump. What is the best way of correcting this? Editing the file in nano I presume would take forever for it to load.
 
Old 07-05-2008, 09:49 PM   #4
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Quote:
Originally Posted by RAH104 View Post
Both servers are running MySQL 5. Backup was made with mysqldump. What is the best way of correcting this? Editing the file in nano I presume would take forever for it to load.
Yeah, loading a 1.4GB file then trying to edit and save is not something you want to do, not even with vi or any editor.

The way I would approach this is to either edit the file by using sed, might take just as long but could work, I've done this with mysql dumps over 10GB once, knowing the line number helps quicken the process. Or you could try using the command split to split up the file into smaller files. Find the line that has the duplicate column name, edit or remove, finish loading to restore.
 
  


Reply



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
mysql database restore problem sajith Programming 1 07-01-2007 06:36 AM
to restore the database Ameii83 General 3 06-09-2006 04:11 AM
How do I restore a MySQL database simply dobriain Linux - Software 2 04-19-2006 12:05 PM
I lost my urpmi database...how to restore it ? riccisit Mandriva 14 01-22-2006 03:14 AM
Had to restore database from backup - about 5 minutes lost jeremy LQ Suggestions & Feedback 0 01-21-2001 10:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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

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