mysql常用语句备忘

来源:互联网 发布:淘宝diy动铁耳机 编辑:程序博客网 时间:2024/05/17 04:03

创建UTF8数据库:

CREATE DATABASE `log_server` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;

查看某表的分区情况:

select * from INFORMATION_SCHEMA.PARTITIONS where table_name='表名';

查看任务:

show processlist;

显示指定数据库的每个表大小:

select table_name,data_length+index_length as len,table_rows from information_schema.tables where table_schema='dbname' order by len desc;