How to Import MySQL Database via Command Line
by Dinesh[ Edit ] 2014-10-20 13:41:38
Using SSH to import your MySQL database
The file must be in .sql format. It can not be compressed in a .zip or .tar.gz file.
- Upload the SQL file to the server.
- If the database does not exist please create one with an user. Note the username and password.
- Log into the server through SSH
- Navigate to the directory where your .sql file is.
- Type this this command:
- mysql -p -u username database_name < file.sql