A Tutorial on Applescripting MySQL
http://A Tutorial on AppleScripting a mySQL Database.
“MySQL does come with command line control, however, so that one need not be logged into the MySQL server to access the data, and with that ability, one can use AppleScript’s do shell script command to do just about anything with MySQL. “