linux – 运行OPTIMIZE TABLE对表进行碎片整理以获得更好的性能

我正在运行 Linux 64位操作系统.我的MysqL调谐器说的是以下内容
-------- General Statistics --------------------------------------------------
[--] Skipped version check for MysqLTuner script
[OK] Currently running supported MysqL version 5.1.61-log
[OK] Operating on 64-bit architecture

-------- Storage Engine Statistics -------------------------------------------
[--] Status: -Archive -BDB -Federated +InnoDB -ISAM -NDBCluster
[--] Data in MyISAM tables: 1G (Tables: 1914)
[--] Data in InnoDB tables: 4M (Tables: 199)
[!!] Total fragmented tables: 296

-------- Security Recommendations  -------------------------------------------
[OK] All database users have passwords assigned

-------- Performance Metrics -------------------------------------------------
[--] Up for: 6s (7K q [1K qps],142 conn,TX: 8M,RX: 701K)
[--] Reads / Writes: 97% / 3%
[--] Total buffers: 1.7G global + 13.2M per thread (384 max threads)
[OK] Maximum possible memory usage: 6.6G (42% of installed RAM)
[OK] Slow queries: 0% (0/7K)
[OK] Highest usage of available connections: 5% (20/384)
[OK] Key buffer size / total MyISAM indexes: 1.5G/2.7G
[OK] Key buffer hit rate: 97.4% (553K cached / 14K reads)
[OK] Query cache efficiency: 64.6% (4K cached / 6K selects)
[OK] Query cache prunes per day: 0
[OK] Sorts requiring temporary tables: 0% (2 temp sorts / 337 sorts)
[OK] Temporary tables created on disk: 8% (17 on disk / 198 total)
[OK] Thread cache hit rate: 85% (20 created / 142 connections)
[OK] Table cache hit rate: 98% (438 open / 445 opened)
[OK] Open file limit used: 10% (856/8K)
[OK] Table locks acquired immediately: 99% (2K immediate / 2K locks)
[OK] InnoDB data size / buffer pool: 4.2M/8.0M


-------- Recommendations -----------------------------------------------------
General recommendations:
    Run OPTIMIZE TABLE to defragment tables for better performance
    MysqL started within last 24 hours - recommendations may be inaccurate

他们的建议是运行OPTIMIZE TABLE来对表进行碎片整理以获得更好的性能;但我不知道如何通过Putty运行它.

是否有人可以给我代码如何通过Putty运行它?

解决方法

OPTIMIZE TABLE是一个sql语句 – 在MysqL客户端中运行它.

在服务器的命令行上,您应该安装命令行客户端;您可以使用MysqL -u username -p连接到客户端中的数据库.

有关更多信息,请参见documentation on OPTIMIZE TABLE.

相关文章

文件查找(find) 1 find 简单的说,就是实时查找指定的内容或条件。特点:最新、最快、最准确。 用法:...
非交互式添加分区 方法一 添加/deb/sdb 下的分区,其实位置为1到1000M,第二个分区位置为1001至3000M,...
编译安装httpd 1 去官网下载源码包 为避免非法软件,一定要去官网下载http://www.apache.org httpd-2.4...
gdisk用法 gdisk - InteractiveGUIDpartitiontable (GPT) manipulator GPTfdisk (akagdisk) isatext-mo...
1 一定用快捷键 这里简单的说下几个常用的快捷按键。 1.1 移动光标快捷键 Crtl + a 光标回到命令行...
bash shell中测试命令 test命令提供了if-than语句中测试不同条件的途径。如果test命令中列出的条件成立...