【问题标题】:MYSQL Query to count the number of schemas present in mysql serverMYSQL 查询以计算 mysql 服务器中存在的模式数量
【发布时间】:2013-07-15 21:56:57
【问题描述】:

说如果连接是 localhost 其中包含
*information_schema
mysql
性能模式
测试
测试数据库*

查询以检索模式计数
计数(模式)
----------------------
5

【问题讨论】:

    标签: mysql phpmyadmin mysqldump mysql-workbench


    【解决方案1】:
    SELECT COUNT(SCHEMA_NAME) FROM information_schema.SCHEMATA
    

    【讨论】:

      【解决方案2】:

      你可以试试这个

      select count(*) from information_schema.SCHEMATA where schema_name not in
      ('mysql','information_schema');
      

      如果你想要所有数据库

      然后使用

      select count(*) from information_schema.SCHEMATA where schema_name;
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-06-28
        • 1970-01-01
        • 2018-12-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多