ccihosting.com
Have questions? Call us.
Panama: (+507) 264.0852

Importing a MySQL via CLI (Command Line Interface)

CCIHosting.com knowledgebase

How to import a MySQL database via CLI (Command Line Interface)

The file must be in .sql format. It can not be compressed in a .zip or .tar.gz file.

  1. Start by uploading the .sql file onto the CCIHosting server
  2. If you haven't already done so, create the MySQL database via the cpanel. Click Here for video tutorial
  3. Using SSH, navigate to the directory where your .sql file is.
  4. Next run this command:

 mysql -p -u username database_name < file.sql 

To import a single table into an existing database you would use the following command:

mysql -u username -p -D database_name < tableName.sql

Need assistance choosing your right server? We are here to help

Call our sales team at +(507) 264.0852 or talk with us on Live Chat