2016-04-08 53 views
0

我們正在嘗試使用mysqltuner來對我們的Wordpress網站上的一些問題背後的問題有一種看法,但在運行它時幾乎沒有問題(大多數未能執行/返回代碼:256)。MySqlTuner - 失敗:返回代碼256

首先,我們做的:

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

,並執行它:

perl mysqltuner.pl

,但是這就是我們得到:

>> MySQLTuner 1.6.9 - Major Hayden <[email protected]> 
>> 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... 

我們不明白可能是什麼問題呢。謝謝大家提前!

+0

看起來你指定的憑據無效。你有沒有設置任何憑證?另外,你爲什麼認爲一個mysql調諧器腳本可以檢測到與wordpress相關的問題? – Mjh

+0

親愛的@Mjh感謝您的快速回復。我們以root身份運行mysqltuner,我們沒有被要求提供任何憑據。我們不認爲mysqltuner可以檢測到Wordpress問題,但我們正在研究許多變量,包括:php-fpm慢日誌,mysql慢日誌,如果有任何錯誤配置,我們還想用mysqltuner來檢查。 – Lightbox

+0

我試着運行它:'perl mysqltuner.pl --host localhost --user root'和第一行輸出是'[ - ]在localhost上執行測試:3306 [確定]使用傳遞的憑據登錄在命令行上它看起來不錯,但它一直給出所有這些失敗的統計信息 – Lightbox

回答

0

我有同樣的錯誤,由於改變listen端口/重命名root用戶&禁用無密碼local登錄但與固定它:

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

(假定localhost而不--host開關&端口3306假設沒有--port開關)

運行mysqltuner的更好方法是設置一些證書的limited_user(任何名稱將工作)一個/root/.my.cnf

[client] 
user=limited_user 
pass=thatuserspassword 

當時我能夠與limited_user運行:

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

The limited_user只需要權限:

SHOW DATABASES, LOCK TABLES, SELECT ON *.*

&可選SHOW SLAVE STATUS & SHOW SLAVE HOSTS

相關問題