Mysql grant all privileges to User own stuff only

mysql> create user ‘kambing’@’localhost’ identified by ‘gilo’;

mysql>grant all privileges on `kambing_%’.* to ‘kambing’@’localhost;

mysql>flush privileges;

now login using kambing and create database with prefix kambing_

using this technique, user kambing only allowed to create database with preifx kambing_ and only can access kambing_* databases;

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s