Import/Export Mysql Database Using SSH

Import/Export Mysql Database Using SSH

Importing/Exporting MySQL Database using SSH is not a rocket science.

But it is helpful when importing/exporting large databases.

I am posting this because One of our followers Asked Me the question.

Ok, So without wasting time, Let’s start.

Exporting Database to .sql file:

In order to export Database, we’ll gonna use mysqldump command.

To export just login to your SSH client and run following command

mysqldump -u{Sql user} -p{Sql password} {Database} > backup.sql

Chenge Sql username, Sql password and database name with the database you want to export.

After chenging i should looks like mysqldump -uadmin -p1234 admin > backup.sql

It’ll export current database to backup.sql of current directory.

Importing MySQL database:

In order to import Database, Here we’ll use mysql command.

Here we’ll import the Database we just exported.

To import just execute following command.

mysql -u{Sql user} -p{Sql password} {Database} < backup.sql

Similarly change Sql User and Sql password and database name with the database where you want to import.

I know it is a old topic, but hope You found this topic helpful. thank you.

Bubun

Share
Published by
Bubun

Recent Posts

Xiaomi MI A1 Kernel Sources Finally Publicly Released But There Is A Catch!

Hello friends, I have a good news for you all! After a very long period…

7 years ago

[MAGISK] How to Root Mi A1 After Upgrading to Android Oreo

Hello friends, I just received Oreo update on my mi a1. and the disaster happens! As…

7 years ago

Mi A1 Received January 2018 Security patch before January!

Xiaomi MI A1 Received 1 January 2018  security patch even before January! Xiaomi's launched there first…

7 years ago

Top 5 Hand Picked Substratum Samsung Themes Of December 2017

Top 5 Hand-Picked Substratum Samsung Themes Of December 2017 | Our Best Picks! How Are…

7 years ago

Let’s Encrypt Implementation With Express Server Without Nginx ! (Full tutorial)

Let's Encrypt Encrypt SSL certificate along with Express Server Without using Nginx! Hello, Friends, Myself Bubun.…

7 years ago

[LATEST] Apk Extractor v4.2 is here!!!

[LATEST] Apk Extractor v4.2 is here!!! Hello friends, I am Roni today welcome to our…

8 years ago

This website uses cookies.