How can I import a .sql file from the Linux command line?

How can I import a .sql file from the Linux command line?

Answer:


mysql -u username -p database_name < /path/to/file.sql