Friday, March 20, 2009

Always successful Grant statement in MySQL

If you do not want to fail a grant statement in Mysql, you can always include "Create" privilege in the statement. In this way, you can grant privilege to a table that is not existing yet. The table can be a table even in a non-existing database.

E.g

Grant create, select on db.tbl to user@localhost identified by 'TEST'

This statement will alway successfully executed on any mysql server.

No comments: