Import MySQL Database File via Command Line Ubuntu Linux

Importing a MySQL database from the terminal in Linux is very easy. All it takes is one simple line:

mysql -u username -p database_name < myDatabase.sql

Make sure you enter in your MySQL username in place of username. In place of database_name, enter in the name of the database you are importing in to. After you enter this line of code via SSH, you will be prompted for the password of the MySQL user. Go ahead and enter in the password, and your database should get imported.