MySQL五个授权表的功能

来源:这里教程网 时间:2026-02-27 12:13:21 作者:

mysql.user select host,user,password from mysql.user; grant all privileges on *.* to monty@localhost identified by

mysql.user

display:

 

 

  • mysql.db

     

    display:

    Query OK, 0 rows affected (0.00 sec)Empty set (0.00 sec)Query OK, 0 rows affected (0.00 sec)+-----------+-------+------+| host      | user  | db   |+-----------+-------+------+| localhost | monty | test |+-----------+-------+------+1 row in set (0.00 sec)

    mysql.host\

    #未测试

    mysql.tables_priv

    display:

    Empty set (0.00 sec)


    Query OK, 0 rows affected (0.00 sec)


    +-----------+------+------------+-------+
    | host      | db   | table_name | user  |
    +-----------+------+------------+-------+
    | localhost | test | student    | monty |
    +-----------+------+------------+-------+
    1 row in set (0.00 sec)


    Query OK, 0 rows affected (0.00 sec)

    mysql.columns_priv

    display:

    Empty set (0.00 sec)


    Query OK, 0 rows affected (0.00 sec)


    +-----------+------+-------+------------+-------------+-------------+
    | host      | db   | user  | table_name | column_name | column_priv |
    +-----------+------+-------+------------+-------------+-------------+
    | localhost | test | monty | student    | sno         | Select      |
    +-----------+------+-------+------------+-------------+-------------+
    1 row in set (0.00 sec)


    Query OK, 0 rows affected (0.00 sec)

  • 相关推荐