简体   繁体   English

撤销对未应用于 mysql 活动数据库连接的数据库的访问

[英]Revoke access to a database not applied on mysql active DB Connection

I just want to ask how can I apply grants on active connection?我只想问如何在活动连接上申请授权? Currently I'm trying to revoke access to a user for a specific database on active connection and it doesn't work.目前我正在尝试撤销对活动连接上特定数据库的用户的访问权限,但它不起作用。 For exemple if I revoke all privileges to fooUser on database foo , if the user already have some active connections he would still be able to insert/update/select on the database until he makes a new connection... I thought revoking all privileges would kill active connections but it seems like not.例如,如果我在数据库foo上撤销 fooUser 的所有权限,如果用户已经有一些活动连接,他仍然可以在数据库上插入/更新/选择,直到他建立新连接......我认为撤销所有权限会杀死活动连接,但似乎没有。

I expect that if I revoke access to a user connected and or using a specific database he should be "ejected" somehow but it doesn't.我希望如果我撤销对已连接用户或使用特定数据库的用户的访问权限,他应该以某种方式被“弹出”,但事实并非如此。

In the src/main/resources/application.properties file list the below line along with database URL, username, and password for creating a new connection with a database.在 src/main/resources/application.properties 文件中列出以下行以及数据库 URL、用户名和密码,用于创建与数据库的新连接。

spring.jpa.hibernate.ddl-auto=update spring.jpa.hibernate.ddl-auto=update

You must begin with either create or update because you do not yet have the database structure.您必须从 create 或 update 开始,因为您还没有数据库结构。 Use update when you want to make some change to the database structure.当您想对数据库结构进行一些更改时,请使用更新。 The default for H2 and other embedded databases is create-drop. H2 和其他嵌入式数据库的默认设置是 create-drop。 For other databases, such as MySQL, the default is none.对于其他数据库,例如 MySQL,默认为 none。

Once your database is in a production state, set this to none, revoke all privileges from the MySQL user connected to the Spring application, and give the MySQL user only SELECT, UPDATE, INSERT, and DELETE. Once your database is in a production state, set this to none, revoke all privileges from the MySQL user connected to the Spring application, and give the MySQL user only SELECT, UPDATE, INSERT, and DELETE.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM