How to my sql backup and restore via terminal ?

For getting a backup use this on terminal:

 

mysqldump -u dbuser  -pYourPasswordWithoutSpace database_name >  yildizsahasi13.sql.gz

mysqldump -u yildizsahasi13 -p yildizsahasi13 | gzip -9 > yildizsahasi-04-10-2015.sql.gz

 

For restoring your backup:

mysql -u admin -p storedb < /home/mian/storedb.sql

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s