1
rated 0 times
[
1]
[
0]
/ answers: 1 / hits: 1847
/ 3 Years ago, fri, june 11, 2021, 10:36:36
Given:
Directory tree that contains files with .sql
extension.
Requred
Find them all recursively and pass found files one by one to mysql
client as:
mysql < ./dir/subdir/subsubdir/schema.sql
My feeble attempt
find . -name '*.sql' | xargs mysql
Results in:
ERROR 1049 (42000): Unknown database './dir/subdir/subsubdir/schema.sql'
Question
How to do it right?
Thanks!
More From » bash