4

我有一个 MySQL 用户(InnoDB 引擎),我想知道授予它的安全权限是什么?目前,我已授予它访问特定数据库和以下权限的权限:

SELECT, INSERT, UPDATE, DELETE, CREATE, INDEX, ALTER, CREATE TEMPORARY TABLES

但由于它是 InnoDB,我想知道是否需要显式授予该用户 LOCK TABLES 权限?另外我不确定我是否需要为此授予 CREATE TEMPORARY TABLES 。你能帮我弄清楚我应该授予哪些特权吗?Hibernate 将有权访问该用户,所以我也想知道什么才能让它正常工作?

4

1 回答 1

4

You should grant the minimum privileges the users needs in order to use the system.

For testing by all means use a grant all on the database.

Lock things down come production time
But in production you should only grant select on the tables.
Grant insert and update only on tables the user actually needs to add or alter data in.
Create is a privilege that users almost never need. (unless you want them to design the database for you :-).
Ditto for index, alter, you don't want your users to wield that power.
create temp tables may be OK, IF your app creates temp tables.

于 2011-08-22T22:38:54.913 回答