I've been using a home grown scripting language called Raven for a couple of years now. I think it is a good tool for working with MySQL, particularly when one needs to crank out a quick script on the fly using simple and readable code. Currently it spends a lot of time talking to my cluster. Here are the basics...
Connect to the Database:
'mysql://user:password@localhost/test' open as $mysql
Select some records:
'SELECT * FROM mytable' $mysql query as $result
Get the number of selected records:
$result selected as $num_rows
Iterate over the result set and output a CSV:
$result each as $record
$record ',' join print "\n" print
Insert a record and return the last AUTO_INCREMENT value …
[Read more]