Category: MySQL

How to import database in MySQL using terminal

For large and very large SQL file, the best approach is to login your server via SSH and directly import it in the database by this command line after uploading the SQL file in /root via FTP:

mysql -u <username> -p <databasename> < <filename.sql>

And enter the password when it prompts you. It will then start importing wordpress.sql into the databasename database.