首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >MySqlTuner -失败:返回代码256

MySqlTuner -失败:返回代码256
EN

Stack Overflow用户
提问于 2016-04-08 14:03:35
回答 1查看 6.2K关注 0票数 1

我们正在尝试使用mysqltuner来对我们Wordpress网站上一些问题背后的问题有一种设想,但是在运行它时几乎没有什么问题(大多数情况下无法执行/返回代码: 256)。

首先,我们做到了:

wget https://raw.githubusercontent.com/major/MySQLTuner-perl/master/mysqltuner.pl

并以下列方式执行:

perl mysqltuner.pl

但我们得到的是:

代码语言:javascript
复制
 >>  MySQLTuner 1.6.9 - Major Hayden <major@mhtx.net>
 >>  Bug reports, feature requests, and downloads at http://mysqltuner.com/
 >>  Run with '--help' for additional options and output filtering

[--] Skipped version check for MySQLTuner script
[!!] failed to execute: SELECT VERSION()
[!!] FAIL Execute SQL / return code: 256
[!!] failed to execute: SHOW /*!50000 GLOBAL */ VARIABLES
[!!] FAIL Execute SQL / return code: 256
[!!] failed to execute: SHOW /*!50000 GLOBAL */ STATUS
[!!] FAIL Execute SQL / return code: 256
[!!] failed to execute: SHOW ENGINES
[!!] FAIL Execute SQL / return code: 256
[!!] failed to execute: SHOW SLAVE STATUS\G
[!!] FAIL Execute SQL / return code: 256
[!!] failed to execute: SHOW SLAVE HOSTS
[!!] FAIL Execute SQL / return code: 256
[!!] failed to execute: \s
[!!] FAIL Execute SQL / return code: 256
Use of uninitialized value $myvar{"version"} in pattern match (m//) at
    mysqltuner.pl line 1526 (#1)
    (W uninitialized) An undefined value was used as if it were already
    defined.  It was interpreted as a "" or a 0, but maybe it was a mistake.
    To suppress this warning assign a defined value to your variables.

    To help you figure out what was undefined, perl will try to tell you the
    name of the variable (if any) that was undefined. In some cases it cannot
    do this, so it also tells you what operation you used the undefined value
    in.  Note, however, that perl optimizes your program and the operation
    displayed in the warning may not necessarily appear literally in your
    program.  For example, "that $foo" is usually optimized into "that "
    . $foo, and the warning will refer to the concatenation (.) operator,
    even though there is no . in your program.

Use of uninitialized value $mysqlvermajor in numeric gt (>) at mysqltuner.pl
    line 1552 (#1)
Use of uninitialized value $mysqlvermajor in numeric eq (==) at mysqltuner.pl
    line 1552 (#1)
Use of uninitialized value $myvar{"version"} in concatenation (.) or string at
    mysqltuner.pl line 1531 (#1)
[!!] Your MySQL version  is EOL software!  Upgrade soon!
[OK] Operating on 64-bit architecture

-------- Storage Engine Statistics -------------------------------------------
[!!] failed to execute: SHOW DATABASES
[!!] FAIL Execute SQL / return code: 256
[--] Status: -Archive -BDB -Federated -InnoDB -ISAM -NDBCluster 
[OK] Total fragmented tables: 0
[!!] failed to execute: SELECT ~0
[!!] FAIL Execute SQL / return code: 256

-------- Security Recommendations  -------------------------------------------
Use of uninitialized value $myvar{"version"} in pattern match (m//) at
    mysqltuner.pl line 1345 (#1)
[!!] failed to execute: SELECT CONCAT(user, '@', host) FROM mysql.user WHERE TRIM(USER) = '' OR USER IS NULL
[!!] FAIL Execute SQL / return code: 256
[OK] There are no anonymous accounts for any database users
[!!] failed to execute: SELECT CONCAT(user, '@', host) FROM mysql.user WHERE (password = '' OR password IS NULL) AND plugin NOT IN ('unix_socket', 'win_socket')
[!!] FAIL Execute SQL / return code: 256
[OK] All database users have passwords assigned
[!!] failed to execute: SELECT CONCAT(user, '@', host) FROM mysql.user WHERE CAST(password as Binary) = PASSWORD(user) OR CAST(password as Binary) = PASSWORD(UPPER(user)) OR CAST(password as Binary) = PASSWORD(UPPER(LEFT(User, 1)) + SUBSTRING(User, 2, LENGTH(User)))
[!!] FAIL Execute SQL / return code: 256
[!!] failed to execute: SELECT CONCAT(user, '@', host) FROM mysql.user WHERE HOST='%'
[!!] FAIL Execute SQL / return code: 256
[!!] There is no basic password file list!

-------- CVE Security Recommendations  ---------------------------------------
[--] Skipped due to --cvefile option undefined
Use of uninitialized value $mystat{"Questions"} in numeric lt (<) at
    mysqltuner.pl line 1868 (#1)
[!!] Your server has not answered any queries - cannot continue...

我们不明白有什么问题。提前谢谢大家!

EN

回答 1

Stack Overflow用户

发布于 2017-01-21 20:28:39

由于更改listen端口/重命名root用户&禁用无密码local登录,我也犯了同样的错误,但是用以下方法修复了它:

/path/to/mysqltuner.pl --port xxxx --user xxxx --pass xxxx

(localhost假设没有--host交换机,端口3306假设没有--port交换机)

运行limited_user的一种更好的方法是为mysqltuner设置一个具有某些凭据的/root/.my.cnf (任何名称都可以):

代码语言:javascript
复制
[client]
user=limited_user
pass=thatuserspassword

那时我能够用limited_user运行。

/path/to/mysqltuner.pl --port 5555 --user limited_user

limited_user只需要以下权限:

SHOW DATABASES, LOCK TABLES, SELECT ON *.*

&可选SHOW SLAVE STATUSSHOW SLAVE HOSTS

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/36501682

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档