开发者

create a readonly connection to MySQL?

开发者 https://www.devze.com 2022-12-31 22:01 出处:网络
I looked at the MySql Connection Options and it doesnt seem to be there. Is there a way to create a read only connection/command for .NET? With SQLite i could specify read only=true to do this. What c

I looked at the MySql Connection Options and it doesnt seem to be there. Is there a way to create a read only connection/command for .NET? With SQLite i could specify read only=true to do this. What can i 开发者_如何学Godo with MySQL?


You can create a user with SELECT only privileges


You need to add SELECT privileges to a user using GRANT eg:

GRANT SELECT ON db_base.* TO db_user@'localhost' IDENTIFIED BY 'db_passwd';

Resources:

The MySQL Access Privilege System
MySQL grant

0

精彩评论

暂无评论...
验证码 换一张
取 消