Posts tagged Mysql Backup a single table from the database

Backup Single Table from a database using MySQLdump

We normally backup entire database using mysqldump utility but what if only one table gets corrupt and you  only want to  restore  that table from backup.

In that case you can  use the below simple steps to backup and restore a single mysql table using   mysqldump utility ::

Backup ::

 mysqldump -u -p databasename tablename > tablename.sql

example ::

mysqldump  psa BackupsScheduled > BackupsScheduled.sql -u admin -p`cat /etc/psa/.psa.shadow`

Restoration ::

 mysql -u -p   databasename  <  tablename.sql

for example ::

mysql  psa < BackupsScheduled.sql -u admin -p`cat /etc/psa/.psa.shadow`


That’s all,  easy isn’t it.