Drop the tables manually then try the restore.

[snip]
ERROR 1051 at line 11: Unknown table 'alarm'
ERROR 1050 at line 12: Table 'alarm' already exists
[/snip]

It seems strange that you get these errors in this order. If you post maybe
the first 15 lines of your dump file, I may be able to provide more help.

---
Tom Crimmins
Interface Specialist
Pottawattamie County, Iowa

-----Original Message-----

Hi,
     Thank you for your reply. Even though I used the --add-drop-table
option, I am getting the error messages. Actually I am taking the backup
for a group of tables as following


D:\Code\OPS\6.9.1.12\NetMgmt\OPS_src\C_src\backupmnms\Debug>mysqldump
-uMNMSDBA -p
MNMSDBA  --databases mnms --add-drop-table --add-locks --disable-keys -f

--tables ALARM ALARM_CATEGORY ALARM_REPORT ALARM_REPORT_CATEGORY
ALARMINFO  >  c:\progra~1\mitel\opsman~1\temp\almhist.dmp


And doing the restoring as


D:\Code\OPS\6.9.1.12\NetMgmt\OPS_src\C_src\backupmnms\Debug>mysql
-uMNMSDBA -pMNMS
DBA  -f mnms  <  c:\progra~1\mitel\opsman~1\temp\almhist.dmp
ERROR 1051 at line 11: Unknown table 'alarm'// Trying to drop alarm
table
ERROR 1050 at line 12: Table 'alarm' already exists //Creating alarm
ERROR 1051 at line 72: Unknown table 'alarm_report' //Drop
alarm_category
ERROR 1050 at line 73: Table 'alarm_report' already exists//Create
ERROR 1062 at line 94: Duplicate entry '1' for key 1 // Insert
ERROR 1062 at line 95: Duplicate entry '4' for key 1 // Insert
ERROR 1062 at line 96: Duplicate entry '5' for key 1  // Insert
ERROR 1062 at line 97: Duplicate entry '8' for key 1 // Insert
ERROR 1062 at line 98: Duplicate entry '10' for key 1 // Insert
ERROR 1062 at line 99: Duplicate entry '11' for key 1 // Insert
ERROR 1062 at line 100: Duplicate entry '13' for key 1 // Insert
ERROR 1062 at line 101: Duplicate entry '15' for key 1 // Insert
ERROR 1062 at line 102: Duplicate entry '16' for key 1 // Insert
ERROR 1062 at line 103: Duplicate entry '17' for key 1 // Insert

Note : ALARM, ALARM_CATEGORY, ALARM_REPORT, ALARM_REPORT_CATEGORY,
ALARMINFO   all belongs to one group.

Alarm and Alarm_category are parent and child tables.

ALARM_REPORT, ALARM_REPORT_CATEGORY are parent and child tables



Please advise me, how to get rid of the above error messages.



Thanks,
Narasimha
-----Original Message-----

Hi,

with which options of mysqldump you have taken backup. if you
use --add-drop-table option then it will add drop table statement in
dump
file. otherwise it wont add that statement and you will get that type of
errors.

if you didn't use that option then drop the schema and then try to
restore
it from backup file.


Thanks
Anil




-----Original Message-----

Hi,
     Thank you for your reply. If I have the create table info in my
dump file, while doing the restore using mysql dbname < dump.dmp, I am
getting errors like

mysql  -uMNMSDBA -pMNMSDBA  -f mnms  <
c:\progra~1\mitel\opsman~1\temp\almhist.dmp

ERROR 1050 at line 11: Table 'alarm' already exists
ERROR 1050 at line 40: Table 'alarm_category' already exists
ERROR 1050 at line 70: Table 'alarm_report' already exists
ERROR 1062 at line 91: Duplicate entry '1' for key 1
ERROR 1062 at line 92: Duplicate entry '4' for key 1
ERROR 1062 at line 93: Duplicate entry '5' for key 1
ERROR 1062 at line 94: Duplicate entry '8' for key 1
ERROR 1062 at line 95: Duplicate entry '10' for key 1
ERROR 1062 at line 96: Duplicate entry '11' for key 1
ERROR 1062 at line 97: Duplicate entry '13' for key 1
ERROR 1062 at line 98: Duplicate entry '15' for key 1
ERROR 1062 at line 99: Duplicate entry '16' for key 1
ERROR 1062 at line 100: Duplicate entry '17' for key 1
ERROR 1050 at line 108: Table 'alarm_report_category' already exists
ERROR 1050 at line 137: Table 'alarminfo' already exists
ERROR 1062 at line 155: Duplicate entry '56' for key 1
ERROR 1062 at line 156: Duplicate entry '57' for key 1
ERROR 1062 at line 157: Duplicate entry '58' for key 1
ERROR 1062 at line 158: Duplicate entry '59' for key 1
ERROR 1062 at line 159: Duplicate entry '75' for key 1
ERROR 1062 at line 160: Duplicate entry '76' for key 1
ERROR 1062 at line 161: Duplicate entry '77' for key 1


Please advise me, how to suppress the above error messages.

While taking backup used

mysqldump  -uMNMSDBA -pMNMSDBA  --databases mnms --add-locks
--disable-keys -f --tables ALARM ALARM_CATEGORY ALARM_REPORT
ALARM_REPORT_CATEGORY ALARMINFO   >
c:\progra~1\mitel\opsman~1\temp\almhist.dmp


Please help me in this.

Thanks,
Narasimha



-----Original Message-----
From: Tom Crimmins [mailto:[EMAIL PROTECTED]
Sent: Monday, January 03, 2005 10:55 AM
To: Lakshmi NarasimhaRao (WT01 - TELECOM SOLUTIONS)
Cc: mysql@lists.mysql.com
Subject: RE: backup/restore

[snip]
I am doing backup for tables using Mysqldump. But while doing the
restore I
am not able to do that using the same Mysqldump. Could you please help
me in
that.
[/snip]

mysqldump is not intended to be used for the restore.

You need to run the following:

mysql -D dbname < mysqldumpfile

You may have to specify a user and password as well, depending on your
setup.

---
Tom Crimmins
Interface Specialist
Pottawattamie County, Iowa


-----Original Message-----
Hi,

       I am doing backup for tables using Mysqldump. But while doing the
restore I am not able to do that using the same Mysqldump. Could you
please
help me in that.




For backup : using   Mysqldump -databases <db_name> ---tables table1
table2 > dump.dmp

For restore : used  Mysqldump -databases <db_name> < dump.dmp




In the above, I am not able to restore the data.




Please help us for a good solution.




Thanks,

Narasimha





Confidentiality Notice


The information contained in this electronic message and any attachments
to
this message are intended for the exclusive use of the addressee(s) and
may
contain confidential or privileged information. If you are not the
intended
recipient, please notify the sender at Wipro or [EMAIL PROTECTED]
immediately and destroy all copies of this message and any attachments.



Confidentiality Notice

The information contained in this electronic message and any attachments
to
this message are intended
for the exclusive use of the addressee(s) and may contain confidential
or
privileged information. If
you are not the intended recipient, please notify the sender at Wipro or
[EMAIL PROTECTED] immediately
and destroy all copies of this message and any attachments.




Confidentiality Notice


The information contained in this electronic message and any attachments to
this message are intended
for the exclusive use of the addressee(s) and may contain confidential or
privileged information. If
you are not the intended recipient, please notify the sender at Wipro or
[EMAIL PROTECTED] immediately
and destroy all copies of this message and any attachments.

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to