Mysql获取数据库中存在的字典信息

mac2022-06-30  27

有时候自己写工具需要从远程数据库中获得各种表信息,这样首先就要取得数据字典

列一下mysql的获取方式

use information_schema; select schema_name from schemata; select table_name from tables where table_schema='information_schema' order by table_name;

1.首先use一下information_schema

2.从schemata表中获取出可用的schema_name

3.根据schema_name从tables表中获取到各个table的名称

转载于:https://www.cnblogs.com/dindin2046/p/4507775.html

最新回复(0)