views:

28

answers:

2

Ok, so I'm in need to restore a table and I do:

mysqldump --opt database table_name < table_name.sql 

I hit enter and Done! Well, not really, when I go to see if there is anything on the table it show 0 records.

I have look into the table_name.sql and I see two records.

What am I doing wrong?

+1  A: 

mysqldump is the wrong command for restoring from a backup.

You need to run mysql, as in, the mysql client. It's generally something like this:

mysql -u username -p database_name < sqlfile.sql

That will use your file as input to the mysql client, which subsequently executes the SQL.

zombat
Ok, getting one step further. Now I'm getting: Table 'table_name' already exists. Do can I import the data then?
Ole Media
You'll have to drop the table first before you can import a dumped table.
zombat
A: 
Osama ALASSIRY