欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

MySQL五个授权表的功能

程序员文章站 2024-01-18 15:32:16
...

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)

    MySQL五个授权表的功能