Use the following:
1 |
mysql -u database_username -p database_name < database_file.sql |
If your database has errors and you want to import it anyway, use the –force (-f) flag. Rather than stopping on the offending statement, MySQL will continue and just log the errors to the console:
1 |
mysql -u database_username -p -f -D database_name < database_file.sql |