Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: How to execute sql scripts via perl

by samtregar (Abbot)
on Mar 04, 2009 at 05:55 UTC ( #747995=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
      # read foo.sql into memory
      open my $fh, "<", "foo.sql" or die $!;
    ...
    
      # run each command
      $dbh->do($_) for @commands;
    
  2. or download this
      system("mysql -hhost -uname -ppass db < foo.sql") == 0
        or die "Failed: $?";
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://747995]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (2)
As of 2022-06-28 02:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My most frequent journeys are powered by:









    Results (89 votes). Check out past polls.

    Notices?