Download and Restore MySql database via SSH?

Jovani

Active member
Joined
Jul 10, 2012
Messages
338
Points
28
Hello, can anyone guide me any simple steps to download and restore MySql database via SSH on my VPS?
I used to do it via cPanel but i heard someone said that do it via SSH very fast.
please give me your tips.
 

Hassan

New member
Joined
Nov 11, 2014
Messages
706
Points
0
Exporting MySQL Data
1:Log into your server via SSH.
2:Using SSH, execute the following command:
Code:
mysqldump -p -u username database_name > dbname.sql
Provide password for database user and press enter The file dbname.sql now holds a backup of your database.

Import A MySQL Database
1: Start upload your .sql file to host if you dont have a database yet you can create from control panel.
2: Login to SSH.
3: Using SSH, navigate to the directory where your .sql file is.
4: perform following command:
Code:
mysql -p -u username database_name < file.sql
 
Newer threads
Replies
4
Views
3,273
Replies
5
Views
4,630
Replies
9
Views
3,793
Replies
3
Views
4,425
Latest threads

Referral contests

Referral link for :

Sponsors

Popular tags

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top