Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to grant Select on ALL tables in ALL databases on a server?

Tags:

sql

mysql

Firstly, apologies for what I assume is a really basic question. Google doesn't seem to have an answer that applies to my needs here, but I feel like I'm missing something painfully obvious. Aside from recreating a user on every individual database, is there a concise way to do what I want? I'm looking for something like.

GRANT SELECT ON (SHOW DATABASES) TO user_foo;

like image 639
Ant Vena Avatar asked Jun 18 '18 01:06

Ant Vena


1 Answers

As mention, you can use below query:

GRANT SELECT ON *.* TO 'user'@'localhost';

All you need can be found in this link: my sql grant user permissions

like image 65
Jacky Avatar answered Sep 30 '22 13:09

Jacky