user1658296
user1658296

Reputation: 1418

Grant permissions to mysql user for future databases

I followed this post Grant on multiple databases. MySQL to be able to grant permissions over multiple databases to a mysql user. But I also want to make sure that these permissions persist when a new databases is added to the mysql server. Is there a way to do this?

Upvotes: 3

Views: 1685

Answers (2)

Altmish-E-Azam
Altmish-E-Azam

Reputation: 1583

If you grant all database and all table access to any MySQL user while creating then user can access all database/table created after creation of user account.

GRANT ALL PRIVILEGES ON *.* TO 'user'@'host'  WITH GRANT OPTION;

Upvotes: 9

Venkata Krishna
Venkata Krishna

Reputation: 1776

You can use

GRANT ALL PRIVILEGES ON *.* TO 'user'@'hostname';

. represents database.table. * indicates all databases and all their tables.

Upvotes: 0

Related Questions