0

How to import an SQL file using the command line in MySQL?

Unix

mysql -u username -p database_name < file.sql

Windows

mysql -p -u username database_name < backup-file.sql

PowerShell

C:\> cmd.exe /c "mysql -u root -p db_name < backup-file.sql"
add comment
Suggest a different solution or add another example