Simple - brilliant. I've modified to cat a temporary script...

1) cat the file as suggested:
cat > ~/payload/scripts/create_mysqldb.sql << EOF
###---
### Display the current user
###---
create database puppet;


###---
### Display all default accounts
###---
USE puppet;


###---
### Remove anonymous accounts
###---
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, ALTER ON puppet.* TO 'admin'@'localhost' IDENTIFIED BY '$PASSWD_PRIV_ROOT';
(variables are expanded)

###---
### Verify new admin account was added
###---
SELECT user,Host,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv,Alter_priv from mysql.db;
EOF

2) Execute the script

3) Remove the script
rm -f ~/payload/scripts/create_mysqldb.sql

It is often the simplest things that are most beautiful. Thanks for pulling my head out :D


TT







On 07/29/2010 03:19 PM, Travis Ard wrote:
mysql<<EOF
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, ALTER ON concrete5.db TO 
'admin'@'localhost' IDENTIFIED BY '$PASSWD_PRIV_ROOT';
EOF

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=arch...@jab.org

Reply via email to