数据库
2022-02-10
2022-02-10
我将仇恨写在冰上,然后期待太阳的升起。——加西亚马尔克斯
打开mysql
官方文档:Information Functions
可以看到mysql
查询库表信息的函数
Name Description BENCHMARK()
Repeatedly execute an expression CHARSET()
Return the character set of the argument COERCIBILITY()
Return the collation coercibility value of the string argument COLLATION()
Return the collation of the string argument CONNECTION_ID()
Return the connection ID (thread ID) for the connection CURRENT_ROLE()
Return the current active roles CURRENT_USER()
,CURRENT_USER
The authenticated user name and host name DATABASE()
Return the default (current) database name FOUND_ROWS()
For a SELECT with a LIMIT clause, the number of rows that would be returned were there no LIMIT clause ICU_VERSION()
ICU library version LAST_INSERT_ID()
Value of the AUTOINCREMENT column for the last INSERT ROLES_GRAPHML()
Return a GraphML document representing memory role subgraphs ROW_COUNT()
The number of rows updated SCHEMA()
Synonym for DATABASE() SESSION_USER()
Synonym for USER() SYSTEM_USER()
Synonym for USER() USER()
The user name and host name provided by the client VERSION()
Return a string that indicates the MySQL server version
除了USER
、VERSION
、LAST_INSERT_ID
以外等常用函数还有DATABASE
这个可以用于获取当前USE
的数据库
例如获取当前数据库中的所有表,sql
如下:
1 |
|
这些函数常用的场景如代码生成器和数据库备份维护应用等