I am new to MySQL. I am trying to figure out how to make a table publicly readable to all authenticated users. In Oracle I would say grant select on tablename to public. This syntax does not work with MySQL and I cannot figure out the equivalent syntax.
解决方案MySQL does not support wildcards in user names. To refer to an
anonymous user, specify an account with an empty user name with the
GRANT statement:
GRANT ALL ON test.* TO ''@'localhost'
In this case, any user who connects from the local host with the
correct password for the anonymous user will be permitted access, with
the privileges associated with the anonymous-user account.
So you can grant select to anyone from localhost like
grant select on tablename to ''@'localhost'
(OR)
You can grant all users from a specific domain. Excerpt from MySQL doc
You can specify wildcards in the host name. For example,
user_name@'%.example.com' applies to user_name for any host in the
example.com domain, and user_name@'192.168.1.%' applies to user_name
for any host in the 192.168.1 class C subnet.
The simple form user_name is a synonym for user_name@'%'.