Import an SQL file using the command line in MySQL
Question:
How to import an SQL file using the command line in MySQL? Answer:
mysql -u username -p database_name < file-to-import.sql
Description:
If you want to import data into your MySQL database using the command line use the mysql
command. You need to define the username, password and the database where you want to import data from the SQL file.
Reference:
MySQL command line reference
Share "How to import an SQL file using the command line in MySQL?"
Related snippets:
Tags:
importing SQL file, command line, windows Technical term:
Import an SQL file using the command line in MySQL?