mysql数据库信息函数
打开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
如下:
select * from information_schema.tables where table_schema = (select database());
这些函数常用的场景如代码生成器和数据库备份维护应用等
相关文章
- 查询mysql的隔离级别_怎么查看数据库隔离级别
- MySQL Status Uptime 数据库状态作用意思及如何正确
- MySQL字符串拼接功能: 让你快速搞定(mysql字符串拼接函数)
- MySQL中实现字符串截取的方法(mysql的截取字符串)
- 「深入解析全国各个地区的 Mysql 数据库排名表」(全国地区表mysql)
- 自增MySQL结果集实现自增序号的方法(mysql结果集序号)
- MySQL大数据库导入指南(mysql大数据库导入)
- MySQL存储过程实战:学习实用技巧,提升数据库操作效率(mysql存储过程实战)
- 解决 MySQL 数据库误删问题的有效方法(mysql数据库误删)
- 「MySQL锁查询方法详解」(mysql查询是否锁)
- MySQL中建表和编码优化技巧(mysql 建表 编码)
- 中文编码在MySQL中的应用(mysql中中文成)
- 使用Celery和MySQL实现异步任务自动化(celery mysql)
- MySQL数据库应用技巧三段提交详解(mysql 三段提交)
- MySQL三表联查跨表查询数据技巧详解(mysql 三个表联查)
- 如何设置MySQL数据库中的三个联合主键(mysql三个联合主键)
- MySQL中不小于函数的使用方法(mysql不小于函数)