Why can a user created in Navicat with query permissions for one database access all databases?

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 在navicat上创建用户并赋予一个库的查询条件,为什么能 到所有库

| username: TiDBer_TVKpabeM

[TiDB Usage Environment] Production Environment / Testing / Poc
[TiDB Version]
[Reproduction Path] What operations were performed when the issue occurred
Using the modified user account password to log in can see information about all databases



[Encountered Issue: Issue Phenomenon and Impact]
1686898953847
Hope to see only one database with permissions, is this supported?
[Resource Configuration] Enter TiDB Dashboard - Cluster Info - Hosts and take a screenshot of this page
[Attachments: Screenshots/Logs/Monitoring]

| username: zhanggame1 | Original post link

Show me the statements for creating a user and granting privileges.

| username: TiDBer_TVKpabeM | Original post link

Directly done in Navicat.

| username: 啦啦啦啦啦 | Original post link

show grants for xf_xs@‘%’;

| username: zhanggame1 | Original post link

Manual execution: Navicat can also be used

Create user test

CREATE USER 'test'@'%' IDENTIFIED BY 'test123!';

Delete user test

DROP USER 'test'@'%';

Grant test user permissions on the test database

GRANT ALL PRIVILEGES ON test.* TO 'test'@'%';

Revoke permissions

REVOKE ALL PRIVILEGES ON test.* FROM 'test'@'%';

In Navicat, you can add a user and assign permissions by selecting the database.

| username: TiDBer_TVKpabeM | Original post link

| username: TiDBer_TVKpabeM | Original post link

After executing this, you can still see all the databases.

| username: 啦啦啦啦啦 | Original post link

Check if the connection properties in Navicat are configured for a different account. This kind of situation shouldn’t normally occur.

| username: TiDBer_TVKpabeM | Original post link

Yes, I have confirmed it several times.

| username: 啦啦啦啦啦 | Original post link

Additionally, check select user, host from mysql.user where user='xf_xs' to see if there are accounts with the same name but different IP restrictions.

| username: redgame | Original post link

Create a new user and follow the instructions given above.

| username: linnana | Original post link

What is the version number of Navicat?