sql

作者: James0824 | 来源:发表于2019-01-03 17:49 被阅读0次

    select CONCAT('|',COLUMN_NAME,'|',IF(COLUMN_COMMENT,1,0),'|') from information_schema.COLUMNS where table_name = 'web_site'; ##markdown

    show global variables like "%timeout%"; ##查询数据库超时设置

    查询数据库大小Mb
    SELECT SUM(data_size+index_size) FROM 
    (SELECT
        table_schema,
        concat(
            TRUNCATE (
                sum(data_length) / 1024 / 1024,
                2
            )
        ) AS data_size,
        concat(
            TRUNCATE (
                sum(index_length) / 1024 / 1024,
                2
            )
        ) AS index_size
    FROM
        information_schema. TABLES
    GROUP BY
        table_schema
    ORDER BY
        data_length DESC) AS t
    

    相关文章

      网友评论

          本文标题:sql

          本文链接:https://www.haomeiwen.com/subject/eddqrqtx.html