ITPub博客

首页 > 数据库 > MySQL > MySQLTuner的介绍

MySQLTuner的介绍

原创 MySQL 作者:psufnxk2000 时间:2015-12-07 14:34:19 0 删除 编辑
可以快速的review mysql 的安装 ,并提出优化的建议:
可以在http://mysqltuner.com/ 下载


使用的时候遇到的问题:

# perl mysqltuner.pl
Please enter your MySQL administrative login: root
Please enter your MySQL administrative password: [!!]  Attempted to use login credentials, but they were invalid.
mysql进程是在的,
通过root可以登陆,并且有权限。
通过查看perl脚本:
原来他要这样
 mysqladmin  ping -uroot -ptest
Warning: Using a password on the command line interface can be insecure.
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111)'
Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists!
使用ln -s 建立连接
ln -s  /opt/data/5907bf0512dc/mysqld.sock /tmp/mysql.sock
mysqladmin  ping -uroot -ptest
Warning: Using a password on the command line interface can be insecure.
mysqld is alive



内容的格式如下:

-------- Performance Metrics ------------------------------------------------- 
[--] Up for: 1h 7m 45s (1K q [0.469 qps], 642 conn, TX: 234K, RX: 285K) 
[--] Reads / Writes: 100% / 0% 
[--] Binary logging is enabled (GTID MODE: ON) 
[--] Total buffers: 5.0G global + 13.3M per thread (151 max threads) 
[!!] Maximum reached memory usage: 5.1G (266.65% of installed RAM) 
[!!] Maximum possible memory usage: 7.0G (368.77% of installed RAM) 
[OK] Slow queries: 0% (0/1K) 
[OK] Highest usage of available connections: 1% (2/151) 
[OK] Aborted connections: 0.31% (2/642) 
[!!] Query cache is disabled 
[OK] Sorts requiring temporary tables: 0% (0 temp sorts / 2 sorts) 
[OK] Temporary tables created on disk: 0% (0 on disk / 19 total) 
[OK] Thread cache hit rate: 99% (2 created / 642 connections) 
[!!] Table cache hit rate: 1% (4 open / 388 opened) 
[OK] Open file limit used: 0% (5/5K) 
[OK] Table locks acquired immediately: 100% (683 immediate / 683 locks) 
[OK] Binlog cache memory access: 0% ( 0 Memory / 0 Total) 

-------- MyISAM Metrics ----------------------------------------------------- 
[!!] Key buffer used: 18.8% (3K used / 16K cache) 
[!!] Key buffer size / total MyISAM indexes: 16.0K/98.0K 
[!!] Read Key buffer hit rate: 83.3% (6 cached / 1 reads) 

-------- InnoDB Metrics ----------------------------------------------------- 
[--] InnoDB is enabled. 
[OK] InnoDB buffer pool / data size: 5.0G/176.0K 
[!!] InnoDB buffer pool instances: 8 
[!!] InnoDB Used buffer: 0.13% (424 used/ 327676 total) 
[OK] InnoDB Read buffer efficiency: 96.61% (12122 hits/ 12547 total) 
[!!] InnoDB Write buffer efficiency: 0.00% (0 hits/ 1 total) 
[OK] InnoDB log waits: 0.00% (0 waits / 1 writes) 

-------- AriaDB Metrics ----------------------------------------------------- 
[--] AriaDB is disabled. 

-------- Replication Metrics ------------------------------------------------- 
[--] No replication slave(s) for this server. 
[--] This is a standalone server.. 

-------- Recommendations ----------------------------------------------------- 
General recommendations: 
Set up a Secure Password for user@host ( SET PASSWORD FOR 'user'@'SpecificDNSorIp' = PASSWORD('secure_password'); ) 
Restrict Host for user@% to user@SpecificDNSorIp 
2 user(s) used basic or weaked password. 
MySQL started within last 24 hours - recommendations may be inaccurate 
Reduce your overall MySQL memory footprint for system stability 
Increase table_open_cache gradually to avoid file descriptor limits 
Read this before increasing table_open_cache over 64: http://bit.ly/1mi7c4C 
Beware that open_files_limit (5000) variable 
should be greater than table_open_cache ( 4) 
Variables to adjust: 
*** MySQL's maximum memory usage is dangerously high *** 
*** Add RAM before increasing MySQL buffer variables *** 
query_cache_type (=1) 
table_open_cache (> 4) 
key_buffer_size (> 98.0K) 
innodb_buffer_pool_instances(=5) 



转载请注明源出处 
QQ 273002188 欢迎一起学习 
QQ 群 236941212 
oracle,mysql,mongo 相互交流

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/25099483/viewspace-1867504/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2011-05-31

  • 博文量
    215
  • 访问量
    700288