• Home
  • WordPress
  • Hosting
    • Budget Hosting
    • Business Hosting
    • Email Hosting
    • Reseller Hosting
  • Domain
    • Domain Pricing
  • Servers
    • Dedicated Servers
    • Vps Servers
  • Security
    • SSLs
      • Domain Validation SSL
      • Extended Validation SSL
      • Organization Validation SSL
      • Wildcard SSL
    • Fix Hacked Website
xoftmade-logo xoftmade-logo
  • Home
  • WordPress
  • Hosting
    • Budget Hosting
    • Business Hosting
    • Email Hosting
    • Reseller Hosting
  • Domain
    • Domain Pricing
  • Servers
    • Dedicated Servers
    • Vps Servers
  • Security
    • SSLs
      • Domain Validation SSL
      • Extended Validation SSL
      • Organization Validation SSL
      • Wildcard SSL
    • Fix Hacked Website
Client Area

How to restore mysql database .sql file using SSH command?

by xoftmade
December 27, 2019
Database

Restoring an Mysql Database is so easy now due to PHPMyAdmin application in most of Hosting control panels. But sometime database size is big enough that cause issues in restoration. Big sized database restoration may cause session time out or any errors that may occur due to out dated sql versions etc. So there is a basic way of restoring the .sql file using SSH command without any issue.

Lets check the restoration way of .SQL file. The file must be in .sql format. It can not be compressed in a .zip or .tar.gz file.

1. Upload the SQL file to the server via the file manager or an FTP client.

2. If the database does not exist, please create a database, a user, and give the user full privileges to the database. Note the username and password.

3. Log into the server through SSH

4. Navigate to the directory where your .sql file is.

5. Type in this command:
mysql -p -u user_name database_name < file.sql

(replace ‘user_name’, ‘database_name’, and ‘file.sql’ with the actual name.)

6. You will be prompted for your database user password, and then your database will be imported.

Tags: cpanel database restorationrestore mysql databasesql restoration command
Share:

Recent Posts

  • Duplicate emails from Google/Gmail to cPanel Webmail
  • Critical cPanel & WHM Authentication Flaw Allows Remote Takeover – Patch Now
  • Now SSLs will Expire in Just 200 Days why!
  • How to disable alt-php binaries from cPanel MultiPHP Manager
  • How to enable or disable root user login in Linux Servers?

Recent Comments

No comments to show.
xoftmade-logo
P50 Plaza, 2nd Floor, Chenab Market, Susan Road, Faisalabad
+92 311 4991414

sales@xoftmade.com

Hosting
  • Managed WordPress Hosting
  • Budget Hosting
  • Business Hosting
  • Email Hosting
  • Reseller Hosting
Company
  • About
  • Blog
  • Affiliate Marketing
  • Terms of Service
  • Contact
Domains
  • Domain Search
  • Domain Pricing
  • WHOIS Lookup
Join Our Newsletter

We’ll send you news and offers.

Social Media
Facebook-f Instagram
© All Rights Reserved - Xoftmade Web Solutions