if you dont want to give a certain user create database permissions, he can run this script
#!/bin/bash
MUSER=”$1″
MPASS=”$2″
MDB=”$3″
# Detect paths
MYSQL=$(which mysql)
AWK=$(which awk)
GREP=$(which grep)
if [ $# -ne 3 ]
then
echo “Usage: $0 {MySQL-User-Name} {MySQL-User-Password} {MySQL-Database-Name}”
echo “Drops all tables from a MySQL”
exit 1
fi
mysql –user=$MUSER –password=$MPASS -BNe “show tables” $MDB | tr ‘\n’ ‘,’ | sed -e ’s/,$//’ | awk [...]

Read Full Post »