Import MySQL – the command line way

Here’s a neat way to import sql script into MySQL database via command line.

mysql -u [database_user_name] -p -h localhost [database_name] 
< [/path/to/sql/file] > null

This will prompt you for the password and you’re done in a jiffy.

Leave a Reply

Your email address will not be published.