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?
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
For Windows:
FOR %%A IN ("*.sql") DO "D:\mysql\Install\MySQL Server 5.5\bin\mysql" --user=scooby --password=pwd123 databasename < %%A >output.tab
cmd (not powershell) I get an error %%A was unexpected at this time.bash:
mysql < <(cat *.sql)
bash. Not sh, not dash, but bash proper. tldp.org/LDP/abs/html/process-sub.html