#!/usr/bin/tclsh package require helga 1.0 if { [info vars ::ADMINSQLPASS] == "" } { puts "Error: you must have administrator access to MySQL to run this script." exit 1 } set db [::mysql::connect -user helgaAdmin -password $::ADMINSQLPASS] set dbNames [::mysql::info $db databases] if { [lsearch $dbNames $::SQLDB] == -1 } { if { [catch "exec mysql -u helgaAdmin --password=$::ADMINSQLPASS -e \"CREATE DATABASE `$::SQLDB`\"" out] } { puts $out } } else { puts "Database already exists." }