MySQL数据库权限问题 [英] MySQL Database Permission Question
问题描述
我已习惯于遵循
GRANT ALL PRIVILEGES ON db_base.phonebook TO db_user @'%' IDENTIFIED BY 'db_passwd';
和其他影响某个用户与mysql交互的事情。我有一个数据库是由我运行的程序创建的,它有自己的权限。我不知道如何编辑该数据库的权限。是的,这是措辞不好,所以我告诉你:
and other things that affect how a certain user interacts with mysql. I have a database that was created by a program I ran and it has its own permissions. I can't figure out how to edit the permissions of that database. Yes, that is worded poorly, so I show you this:
(root@localhost) [mysql]> SELECT host,db,user,select_priv,insert_priv FROM mysql.db;
+------+--------------------+------+-------------+-------------+
| host | db | user | select_priv | insert_priv |
+------+--------------------+------+-------------+-------------+
| % | test | | Y | Y |
| % | test\_% | | Y | Y |
| % | lux_watertank_pmts | lux | Y | N |
+------+--------------------+------+-------------+-------------+
3 rows in set (0.00 sec)
test
数据库我想限制访问。如何更改数据库的priv而不是用户?感谢您的帮助和理解。
The test
database I want to limit access to. How do I change the priv's of a database rather than a user? Thanks for help and understanding.
推荐答案
我遇到了同样的问题(即想限制访问测试默认情况下对所有人开放)。最好的我可以想出是从mysql.db删除以下两行并重新启动mysql。
I have run into the same problem (i.e. wanting to restrict access to the "test" database that is open to all by default). The best I can come up with is deleting the following two lines from mysql.db and restarting mysql.
| % | test | | Y | Y |
| % | test\_% | | Y | Y |
我还没有尝试过,但我相当肯定它会工作。有另一种方法吗?
I haven't tried it yet, but I am fairly certain it will work. Is there another way?
这篇关于MySQL数据库权限问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!