添加用户:
grant all privileges on *.* to apsara@'%' identified by '123456';
grant all privileges on *.* to apsara@'localhost' identified by '123456';
flush privileges;
use information_schema;
select * from USER_PRIVILEGES;
describe $table
show create table $table
show index from $table
show table status like '$table'
create table $table (
logtype int(11) NOT NULL,
appkey varchar(20) DEFAULT NULL,
timestamp bigint(20) NOT NULL,
KEY key_logtype (logtype),
KEY key_appkey (appkey)
) ENGINE=MyISAM DEFAULT CHARSET=utf8
get database and table size:
select sum(DATA_LENGTH)+sum(INDEX_LENGTH) from information_schema.tables