Importing a MySQL via CLI (Command Line Interface)
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.
- Start by uploading the .sql file onto the CCIHosting server
- If you haven't already done so, create the MySQL database via the cpanel. Click Here for video tutorial
- Using SSH, navigate to the directory where your .sql file is.
- 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