Loading

mysql常用语句

1. 创建数据库ruoshui,字符集utf8

create database if not exists ruoshui default charset utf8 collate utf8_general_ci;

 2.查看版本号

select version();或者进入mysql命令行输入status;

 3.查看表大小

 SELECT
  table_schema AS 'Db Name',
  Round( Sum( data_length + index_length ) / 1024 / 1024, 3 ) AS 'Db Size (MB)',
  Round( Sum( data_free ) / 1024 / 1024, 3 ) AS 'Free Space (MB)'
FROM information_schema.tables
GROUP BY table_schema ;

 

posted @ 2017-09-19 11:38  王召波  阅读(168)  评论(0编辑  收藏  举报