标签:mysql管理
1.
mysql查询某数据库中各个表的大小
select TABLE_NAME, concat(truncate(data_length/1024/1024,2),‘ MB‘) as data_size, concat(truncate(index_length/1024/1024,2),‘ MB‘) as index_size from information_schema.tables where TABLE_SCHEMA = ‘表名‘ group by TABLE_NAME order by data_length desc;
UPDATE table_name SET field_name = ‘‘;
2.
查询mysql当前运行的性能状态语句
mysqladmin -uroot --password=‘x1#YuMhoNg*‘ status
mysqladmin -uroot --password=‘x1#YuMhoNg*‘ status -i 5 (每5秒自动刷新一次)
3.
无密码登入mysql
./bin/mysqld_safe --skip-grant-tables
4.
查看mysql权限
查看权限
select host,user from user ;
5.
mysql清理数据
mysql> DELETE FROM `history_uint` WHERE `clock` < 1327939201;
mysql> optimize table history_uint;
本文出自 “汤霖--运维博客” 博客,转载请与作者联系!
标签:mysql管理
原文地址:http://cristiano.blog.51cto.com/10104104/1633361