Duplicate key name when importing mysql dump file
am 17.06.2009 21:59:13 von Jason Novotny
Hi,
I'm trying to import a dumpfile like so:
cat aac.sql | mysql -u root AAC
It all runs fine until I get something like:
ERROR 1061 (42000) at line 5671: Duplicate key name 'FK_mediaZip_to_zipSet'
Is there a way I can tell it to ignore or replace the key?
Thanks, Jason
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org
Re: Duplicate key name when importing mysql dump file
am 19.06.2009 20:49:22 von Isart Montane
--000e0cd6a82c9149fd046cb7fb4c
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Hi Jason,
if you run mysql with -f it will ignore any errors and continue importing
cat aac.sql | mysql -f -u root AAC
Isart
On Wed, Jun 17, 2009 at 8:59 PM, Jason Novotny wrote:
> Hi,
>
> I'm trying to import a dumpfile like so:
>
> cat aac.sql | mysql -u root AAC
>
> It all runs fine until I get something like:
>
> ERROR 1061 (42000) at line 5671: Duplicate key name 'FK_mediaZip_to_zipSet'
>
>
> Is there a way I can tell it to ignore or replace the key?
>
> Thanks, Jason
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
> http://lists.mysql.com/mysql?unsub=isart.montane@gmail.com
>
>
--000e0cd6a82c9149fd046cb7fb4c--
Re: Duplicate key name when importing mysql dump file
am 19.06.2009 21:52:09 von ars k
--000e0cd32d18180363046cb8dc3b
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Hi Jason,
You may have to run "ANALYZE TABLE.." for the particular table for which you
are facing the error. So it'll rebuild the indexes. This would be the best
one to save your data.
We can use the method which Mr.Isart suggested, but it'll ignore the error
and also will lead to data loss.
Regards,
Vinodh.k
On Sat, Jun 20, 2009 at 12:19 AM, Isart Montane wrote:
> Hi Jason,
>
> if you run mysql with -f it will ignore any errors and continue importing
>
> cat aac.sql | mysql -f -u root AAC
>
> Isart
>
> On Wed, Jun 17, 2009 at 8:59 PM, Jason Novotny
> >wrote:
>
> > Hi,
> >
> > I'm trying to import a dumpfile like so:
> >
> > cat aac.sql | mysql -u root AAC
> >
> > It all runs fine until I get something like:
> >
> > ERROR 1061 (42000) at line 5671: Duplicate key name
> 'FK_mediaZip_to_zipSet'
> >
> >
> > Is there a way I can tell it to ignore or replace the key?
> >
> > Thanks, Jason
> >
> > --
> > MySQL General Mailing List
> > For list archives: http://lists.mysql.com/mysql
> > To unsubscribe:
> > http://lists.mysql.com/mysql?unsub=isart.montane@gmail.com
> >
> >
>
--000e0cd32d18180363046cb8dc3b--