在mysql中创建了一个用户,让这个用户只可以查看到某一数据库下的一个表(查看,修改,新增),而且对这个表中某些字段只有查看功能,可以实现吗?我用的mysql界面管理工具是navivat

解决方案 »

  1.   

    授权:
    grant select,insert,update on dbname.tablename to username;对表都有了这些权限,该表下的列肯定也有这些权限了,不能对列只有查看权限.授予的权限可以分为多个层级
    手册里有说明:
    13.5. 数据库管理语句
      

  2.   

    grant select(列名) on dbname.tbname to user@'%'
    grant insert(列名) on dbname.tbname to user@'%'
    grant update(列名) on dbname.tbname to user@'%'
    grant delete(列名) on dbname.tbname to user@'%'
      

  3.   

    http://hi.csdn.net/space-2549608-do-album-picid-725781-goto-down.html
      

  4.   

    http://hi.csdn.net/space-2549608-do-album-picid-725781-goto-down.html这个是图片地址,帮忙看看怎么设置
    我的全局:select
    数据库:select
    表:select,insert
    列:部分表update,不成功
      

  5.   

    mysql> grant select,update,insert on xx.a to mablevi@localhost identified by '12
    3456';
    Query OK, 0 rows affected (0.00 sec)mysql> \q
    ByeC:\>mysql -umablevi -p
    Enter password: ******
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 5
    Server version: 5.1.40-community-log MySQL Community Server (GPL)Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql> show databases;
    +--------------------+
    | Database           |
    +--------------------+
    | information_schema |
    | xx                 |
    +--------------------+
    2 rows in set (0.02 sec)mysql> use xx;
    Database changed
    mysql> select * from xx.a;
    +----+------------+
    | id | number     |
    +----+------------+
    |  1 | 1284024502 |
    |  2 |          3 |
    |  3 |          4 |
    |  4 |          5 |
    +----+------------+
    4 rows in set (0.06 sec)mysql> select * from xx.aa;
    ERROR 1142 (42000): SELECT command denied to user 'mablevi'@'localhost' for tabl
    e 'aa'
      

  6.   

    楼主干嘛非要工具呢,直接一条命令就好了; 
    按照你这图的话,对数据库要有select.
      

  7.   

    第四张图勾选上select
    第三张图勾选上select,update,insert 试下
      

  8.   

    注意文档中columns_priv表的介绍。