V
V
Vi Vola2019-01-29 15:34:10
MySQL
Vi Vola, 2019-01-29 15:34:10

How to hide mysql system database in mysql?

Let's say I create a user:

CREATE USER 'user'@'%' IDENTIFIED BY PASSWORD 'pass';
GRANT SELECT, CREATE, CREATE USER, INSERT, UPDATE, DROP, SUPER, CREATE VIEW, CREATE ROUTINE, EVENT, DELETE ON *.* TO 'user'@'%';

How can I hide the mysql system database from him?
I've tried doing things like
mysql> REVOKE ALL PRIVILEGES ON mysql.* FROM 'user'@'localhost';
ERROR 1141 (42000): There is no such grant defined for user 'user' on host 'localhost'

mysql version 5.1.68. As far as I understand it is important.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Chernykh, 2019-01-29
@hakain

mysql allows you to grant rights to a specific user on a specific database / table and even a column. when you are right distribute
show databases;
will show the database accessible only to this user, the rest will be inaccessible

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question