Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Executing a file of SQL commands against MySQL server

by Gangabass (Vicar)
on Aug 18, 2011 at 02:50 UTC ( #920838=note: print w/replies, xml ) Need Help??


in reply to Executing a file of SQL commands against MySQL server

Why don't you want just make a system() with this command mysql -u username -p password database < sql_file?

Replies are listed 'Best First'.
Re^2: Executing a file of SQL commands against MySQL server
by Neighbour (Friar) on Aug 18, 2011 at 08:35 UTC
    Or, alternatively, use the -e option of the mysql client to parse the sql_file: mysql -u username -p password -e 'source sql_file' database
    This will make the mysql-client read the file instead of piping it in.
Re^2: Executing a file of SQL commands against MySQL server
by metaperl (Curate) on Aug 18, 2011 at 17:50 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://920838]
help
Chatterbox?
choroba still has one more.
[Corion]: I have Thursday and Friday off, so then I might get to converting the rough outlines to more articles ;)
[Corion]: But currently, most of the modules are web-related and I don't like to publish two web articles in a row
[Corion]: Maybe I should do the Filter::Simple release on the next weeked - this would give me one more article to milk from this theme

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (8)
As of 2017-04-24 08:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (437 votes). Check out past polls.