Mysql batch import multiple sql files




















Any ideas? Add a comment. Active Oldest Votes. Etienne Dechamps Etienne Dechamps This will only work if all files end with semicolons after commands. Otherwise you'll get a SQL syntax error.

StanJames Yep, I'm having the same problem! Is there any way to fix that you can think of? I suppose the other solution is to use a bash loop — light24bulbs. Anuchit Anuchit 1 1 silver badge 2 2 bronze badges.

This works for me. The current version of mysql does not allow spaces between -u and username. The same applies for password as well. Ignacio Vazquez-Abrams Ignacio Vazquez-Abrams k gold badges silver badges bronze badges. Learn more. How can I import multiple.

Ask Question. Asked 8 years ago. Active 6 years, 2 months ago. Viewed 16k times. How via one command I can import them? For example; is something like this possible?

Improve this question. Flyk 1, 3 3 gold badges 18 18 silver badges 24 24 bronze badges. Add a comment. Active Oldest Votes. Improve this answer. I thinking there is some way to pipe in the results of a ls into some find command or something.. The nice thing about this approach is that the mysql utility reads in each file instead of having it read from stdin. The only trick is the bash substring replacement to strip out the. Then you can run this very simple script to load the database from those files:.

I say huge , but I guess everything is relative. It took about minutes to split a table, MB dump file for me. Here it is on GitHub.



0コメント

  • 1000 / 1000