how to restore Mysql Database

Asked

Viewed 99 times

0

I tried to do the following to restore the database:

root@m9r9w9gae3 [/bkp/var/lib/mysql]# mysqldump -u root -p nomedobd > /home/nmedobd.sql

or:

root@m9r9w9gae3 [/bkp/var/lib/mysql/nomedobd]# mysqldump -u root -p cfellini_wp > /home/nomedobd.sql

The following error appeared:

mysqldump: Got error: 1017: 
 Can’t find file: ‘./nomedobd/cf_commentmeta.frm’ (errno: 13) when using LOCK TABLES
  • What you presented is not "restore", it is "export". As for error 1017, usually a check table and repair table can solve.

1 answer

1

If you want to RESTORE an existing backup file, you can use the following command:

#mysql -u root -p nomedobd < /home/nmedobd.sql

If you want to GENERATE a backup file, you can use the following command:

#mysqldump  -u root -p nomedobd > /home/nmedobd.sql

I hope I helped. Any doubt, leave a comment.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.