
Some suggestions; Put *.sql in quotes otherwise if you have any .sql files in the current directory the shell will expand *.sql into a list of individual names. There's no space between -p and the password I think you can dump many consecutive sql files into a single invocation of mysql, and this is probably more efficient. -h should be followed by a hostname? Leave it off for localhost. cat `find /home/path/* -name "*.sql"` | mysql -ppassword On 9 March 2010 16:08, Peter Reutemann <fracpete(a)waikato.ac.nz> wrote:
Any idea what is wrong with this command??
find /home/path/* -name *.sql -exec mysql -p password -h < {} \;
I am needing to import about 250 sql files.
Try this:
find /home/path/ -name "*.sql" -exec mysql -p password -h < {} \;
BTW you will have to enter the password 250 times!
Cheers, Peter -- Peter Reutemann, Dept. of Computer Science, University of Waikato, NZ http://www.cs.waikato.ac.nz/~fracpete/ Ph. +64 (7) 858-5174 _______________________________________________ wlug mailing list | wlug(a)list.waikato.ac.nz Unsubscribe: http://list.waikato.ac.nz/mailman/listinfo/wlug
-- Disclaimer: By sending an email to any of my addresses you are agreeing that: 1. I am by definition, "the intended recipient" 2. All information in the email is mine to do with as I see fit and make such financial profit, political mileage, or good joke as it lends itself to. 3. I may take the contents as representing the views of your company. 4. This overrides any disclaimer or statement of confidentiality that may be included on your message.