programing

MySqlTuner - 실패: 반환 코드 256

closeapi 2023. 9. 3. 16:18
반응형

MySqlTuner - 실패: 반환 코드 256

저희는 mysqltuner를 사용하여 Wordpress 웹사이트에 있는 몇 가지 문제의 이면에 무엇이 있을 수 있는지에 대한 일종의 비전을 가지려고 노력하고 있지만 실행할 때 거의 문제가 없습니다(대부분 코드 실행 실패/반복 실패: 256).

처음에는 다음과 같이 했습니다.

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

다음을 사용하여 실행:

perl mysqltuner.pl

하지만 우리가 얻는 것은 다음과 같습니다.

 >>  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...

우리는 무엇이 문제인지 이해할 수 없습니다.여러분들께 미리 감사드립니다!

변경으로 인해 동일한 오류가 발생했습니다.listen포트 / 이름 변경root사용자 및 암호 없는 사용 안 함local로그인하지만 다음을 사용하여 수정:

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

(localhost다음을 제외하고 가정합니다.--host스위치 & 포트3306가 없는 것으로 가정함--port스위치)

더 나은 실행 방법mysqltuner를 설정하는 것입니다./root/.my.cnflimited_user에 대한 몇 가지 자격 증명(모든 이름이 작동함):

[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 STATUS&SHOW SLAVE HOSTS

언급URL : https://stackoverflow.com/questions/36501682/mysqltuner-failed-return-code-256

반응형