Mysql给用户授予数据库表权限

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/hjtlovelife/article/details/90731423

生产环境读写权限用户无法访问其它用户创建的数据库及表,才想起来忘记给目标用户授权了,owner用户创建完数据库及表后给读写权限用户授予权限,授权语句如下:
grant all privileges on databaseName.* to targetUserName@"%" identified by 'targetPassword';
grant select,delete,update,insert on databaseName.* to targetUserName@"%" identified by 'targetPassword';
grant select on databaseName.* to targetUserName@"%" identified by 'targetPassword';

猜你喜欢

转载自blog.csdn.net/hjtlovelife/article/details/90731423