Why is GRANT not working in MySQL?

醉酒当歌 提交于 2019-11-28 17:26:30
The Surrican

what you are selecting are the global privileges. you are however giving database (and host, but that doesnt matter) specific privileges.

GRANT INSERTON wordpress.* TO 'www'@'localhost' IDENTIFIED BY 'basic';

theese permissions are stored in the db table.

just to point you in the right direction:

SHOW GRANTS FOR 'www'@'localhost'

http://dev.mysql.com/doc/refman/5.0/en/show-grants.html

That's not where the most user GRANTed rights are stored - try

SHOW GRANTS FOR 'www'@'localhost'

to see database-specific permissions instead. (A grant would only show up in the user table if it was for all databases.)

Here's a (rather old) step-by-step detail of how permissions are stored in MySQL - I don't think things have changed much.

Ethicalguy Gopal Bogati

This should work:

GRANT ALL PRIVILEGES ON database_name.* TO 'username'@'localhost';

You need to look at mysql.db or mysql.tables_priv tables if you need to select the Y or N if you are trying to do some restrictions of from what page a user can edit or insert or delete... This tables are automatically updated with the Ys and Ns as they are solely designed to show what privileges a user has on tables or columns as opposed to mysql.user whose purpose is to show that there is a certain user who can login(create connection) to a database.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!