Skip to content

Instantly share code, notes, and snippets.

@Korveld
Last active February 29, 2024 18:28
Show Gist options
  • Select an option

  • Save Korveld/7c379f579ca90d1276d18eb778cf08fe to your computer and use it in GitHub Desktop.

Select an option

Save Korveld/7c379f579ca90d1276d18eb778cf08fe to your computer and use it in GitHub Desktop.
Import an SQL file using the command line in MySQL
mysql -u [DATABASE USER] -p [DATABASE NAME] < [PATH TO SQL FILE]
example
mysql -u root -p db_name < "C:/xampp/htdocs/db_file.sql"
MAMP
/applications/MAMP/library/bin/mysql -u user_name -p database_name < /Applications/MAMP/htdocs/database_name.sql
MySQL command line
use short_forms
source E:/work/short_forms/dump_test.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment