Tuesday, January 30, 2007

Separate user for each webapp's MySQL database

The following commands will create a separate user for each MySQL database.

> GRANT ALL PRIVILEGES ON PureExample.* TO 'pureuser'@'localhost' 
IDENTIFIED BY 'purepassword' WITH GRANT OPTION;
> FLUSH PRIVILEGES;


This is good practice when writing web applications, so that each web application has its own database user.

0 comments: