Not the answer you need?
Register and ask your own question!

Query on INFORMATION_SCHEMA.FILES

stofa.kenidastofa.kenida ContributorCurrent User Role Novice
Hi,


Mysql 5.7 introduced FILES table in INFORMATION_SCHEMA. Any user can query the FILES table and ALL files used by mysql, under the DATADIR are listed.
Is there any way to limit the listed files to only to those related to tables owned by the specified user.

For instance , we have USER1 and USER2 where USER1 owns ALL TABLES in DB1, and USER2 owns ALL TABLES in DB2.

The Following grant are given to USER1 and USER2.

GRANT ALL PRIVILEGES ON DB1.* to USER1 identified by 'pwd1';

GRANT ALL PRIVILEGES ON DB2.* to USER2 identified by 'pwd2';

What we want to achieve is when USER1 executes :

SELECT * from INFORMATION_SCHEMA.FILES;

Only the info concerning tables in DB1 should be listed and those IN DB2 should be excluded.

What we are expecting is that the query on FILES table will return the info related only to databases on which the user has the required privileges as done by the query on INFORMATION_SCHEMA.TABLES.


Thanks .

Stofa.
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.