to run a single file you can run in mysql
.\ filename
or you outside of mysql you can run
mysql < filename
I have a directory of sql files so I'm trying to run them all at once by using a wildcard
*.sql
but it doesn't work.
Any ideas?
Make sure you have SQLCMD enabled by clicking on the Query > SQLCMD mode option in the management studio. Suppose you have four . sql files ( script1. sql,script2.
Import Multiple SQL files to Database by using Data Import/Restore in MySQL Workbench is great feature when you need to import multiple SQL files into MySQL Server. If you have created multiple files by using Data Export feature in MySQL Server, SQL Dump file project can be imported by using MySQL Import/Restore.
Assuming you're using bash:
cat *.sql | mysql
for %S in (*.sql) do mysql -u user_name database_name < %S
or
mysql -u user_name -p password database_name < file.sql
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With