i'm feeling kind of dumb lately but i have a customer who wants to install a php bb on their account. i have mysql installed but forgot how to add an db for him as well as a login and password to use.
please help! :)
jtan15
03-01-2001, 08:16 PM
Here's a handy command you can run:
cat <<EOF | /path/to/mysql/bin/mysql -u root --password="ROOT_MYSQL_PASSWORD"
CREATE DATABASE "DATABASE_NAME";
GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER
ON "DATABASE_NAME".*
TO "DATABASE_NAME"@localhost
IDENTIFIED BY "DATABASE_PASSWORD";
EOF
That should do the trick if he wants to connect to mySQL right on the server. If he wants to connect from another system add this:
GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER
ON "DATABASE_NAME".*
TO "DATABASE_NAME"@"HOSTNAME"
IDENTIFIED BY "DATABASE_PASSWORD";
Hope this helps. :)