Troubleshooting of MySQLTuner: Difference between revisions

From LemonWiki共筆
Jump to navigation Jump to search
No edit summary
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
"MySQLTuner is a script written in Perl that will assist you with your MySQL configuration and make recommendations for increased performance and stability."<ref>[https://github.com/major/MySQLTuner-perl major/MySQLTuner-perl: MySQLTuner is a script written in Perl that will assist you with your MySQL configuration and make recommendations for increased performance and stability.]</ref>
"[https://github.com/major/MySQLTuner-perl MySQLTuner] is a script written in Perl that will assist you with your MySQL configuration and make recommendations for increased performance and stability."


__TOC__
__TOC__


== How to resolve: wget command not found ==
== How to resolve: (Cygwin) couldn't find diagnostic data ==
Condition: When I tried to download the MySQLTuner using {{kbd | key=<nowiki>wget</nowiki>}} command but met the error.
 
Solution: [https://superuser.com/questions/693284/wget-command-not-working-in-cygwin terminal - WGET Command Not Working in Cygwin - Super User]
== How to resolve: couldn't find diagnostic data ==
Condition:
Condition:
<pre>
<pre>
Line 17: Line 13:


Solution:
Solution:
# Download the installation file {{kbd | key=<nowiki>setup-x86_64.exe</nowiki>}} of Cygwin from [https://cygwin.com/install.html Cygwin Installation]
# Download the Cygwin installation file {{kbd | key=<nowiki>setup-x86_64.exe</nowiki>}} from [https://cygwin.com/install.html Cygwin Installation]
# Open the command line window
# Install the perl_pods package using either method below:
# To install the packages: perl_pods<ref>[https://stackoverflow.com/questions/36393757/how-do-i-use-diagnostics-for-perl-on-cygwin cpan - How do I 'use diagnostics' for Perl on Cygwin? - Stack Overflow]</ref><ref>[https://cygwin.com/faq/faq.html#faq.setup.cli Does Setup accept command-line arguments?]</ref>. Keyin {{kbd | key=<nowiki>setup-x86_64.exe -q -P "perl_pods"</nowiki>}}
 
'''Method 1: Using Cygwin Setup Window (GUI)'''
# Double-click {{kbd | key=<nowiki>setup-x86_64.exe</nowiki>}} to launch the setup wizard
# Follow the installation wizard until you reach the "Select Packages" screen
# If the view dropdown shows "Pending", change it to "Full" to see all available packages
# Search for "perl_pods" in the search box
# Click on the "Skip" text next to perl_pods to change it to the version number (this selects it for installation)
# Click "Next" to proceed with the installation
 
'''Method 2: Using Command Line (CMD)'''<ref>[https://stackoverflow.com/questions/36393757/how-do-i-use-diagnostics-for-perl-on-cygwin cpan - How do I 'use diagnostics' for Perl on Cygwin? - Stack Overflow]</ref><ref>[https://cygwin.com/faq/faq.html#faq.setup.cli Does Setup accept command-line arguments?]</ref>
# Open a command line window
# Navigate to the directory containing {{kbd | key=<nowiki>setup-x86_64.exe</nowiki>}}, for example: {{kbd | key=<nowiki>cd C:\Downloads</nowiki>}}, then press {{kbd | key=<nowiki>Enter</nowiki>}}
# Enter the following command: {{kbd | key=<nowiki>setup-x86_64.exe -q -P "perl_pods"</nowiki>}}


Environment:
Environment:
* Windows 2008 R2 standard
* Windows 2008 R2 standard
* Cygwin version: CYGWIN_NT-6.1 Win2008R2-0-0 2.9.0(0.318/5/3) 2017-09-12 10:18 x86_64 Cygwin (information returned from {{kbd | key=<nowiki>uname -a</nowiki>}})
* Cygwin version: CYGWIN_NT-6.1 Win2008R2-0-0 2.9.0(0.318/5/3) 2017-09-12 10:18 x86_64 Cygwin (information returned from {{kbd | key=<nowiki>uname -a</nowiki>}})
== How to resolve: (Cygwin) wget command not found ==
Condition: When I tried to download the MySQLTuner using {{kbd | key=<nowiki>wget</nowiki>}} command but met the error.
Solution:
# Download the installation file {{kbd | key=<nowiki>setup-x86_64.exe</nowiki>}} of Cygwin from [https://cygwin.com/install.html Cygwin Installation]
# Open the command line window
# Change to the directory where the file {{kbd | key=<nowiki>setup-x86_64.exe</nowiki>}} located e.g. {{kbd | key=<nowiki>cd C:\Downloads></nowiki>}} and than press the key {{kbd | key=<nowiki>Enter</nowiki>}}
# To install the packages: wget. Keyin {{kbd | key=<nowiki>setup-x86_64.exe -q -P "wget"</nowiki>}} or follow the steps on [https://superuser.com/questions/693284/wget-command-not-working-in-cygwin terminal - WGET Command Not Working in Cygwin - Super User] if you prefer the GUI window.
== How to resolve: (Cygwin) unzip: command not found ==
Condition:
<pre>
$ unzip -l sysschema.zip
-bash: unzip: command not found
</pre>
Solution:
# Download the installation file {{kbd | key=<nowiki>setup-x86_64.exe</nowiki>}} of Cygwin from [https://cygwin.com/install.html Cygwin Installation]
# Open the command line window
# Change to the directory where the file {{kbd | key=<nowiki>setup-x86_64.exe</nowiki>}} located e.g. {{kbd | key=<nowiki>cd C:\Downloads></nowiki>}} and than press the key {{kbd | key=<nowiki>Enter</nowiki>}}
# To install the packages: [https://cygwin.com/packages/summary/unzip.html unzip]. Keyin {{kbd | key=<nowiki>setup-x86_64.exe -q -P unzip</nowiki>}}


== How to resolve: Attempted to use login credentials, but they were invalid. ==
== How to resolve: Attempted to use login credentials, but they were invalid. ==
Line 40: Line 71:
* Check the typo of mysql account and password
* Check the typo of mysql account and password


== references ==
== How to resolve: Performance schema should be activated for better diagnostics ==
Condition:
<pre>
$ perl mysqltuner.pl
-------- Recommendations ---------------------------------------------------------------------------
General recommendations:
    Performance schema should be activated for better diagnostics
 
</pre>
 
Solution:
* Verify the MySQL setting. Execute the SQL query {{kbd | key=<nowiki>SHOW VARIABLES LIKE 'performance_schema'</nowiki>}}. The result should be OFF.
* Stop the MySQL service.
* Open the MySQL configuration file named {{kbd | key=<nowiki>my.ini</nowiki>}} on {{Win}} or {{kbd | key=<nowiki>my.cnf</nowiki>}} on {{Linux}} The file maybe located in different path e.g. C:\xampp\mysql\bin\my.ini  on {{Win}}
* Edit the MySQL configuration file
 
<pre>
[mysqld]
performance_schema = ON
</pre>
 
* Restart the MySQL service.
* Verify the MySQL setting again. Execute the SQL query {{kbd | key=<nowiki>SHOW VARIABLES LIKE 'performance_schema'</nowiki>}}. The result should be ON.
 
== References ==
<references/>
<references/>



Latest revision as of 10:48, 5 November 2025

"MySQLTuner is a script written in Perl that will assist you with your MySQL configuration and make recommendations for increased performance and stability."

How to resolve: (Cygwin) couldn't find diagnostic data[edit]

Condition:

$ perl mysqltuner.pl
couldn't find diagnostic data in /usr/share/perl5/5.26/pods/perldiag.pod /usr/local/lib/perl5/site_perl/5.26/x86_64-cygwin-threads /usr/local/share/perl5/site_perl/5.26 /usr/lib/perl5/vendor_perl/5.26/x86_64-cygwin-threads /usr/share/perl5/vendor_perl/5.26 /usr/lib/perl5/5.26/x86_64-cygwin-threads /usr/share/perl5/5.26 mysqltuner.pl at /usr/share/perl5/5.26/diagnostics.pm line 259, <POD_DIAG> line 711.
Compilation failed in require at mysqltuner.pl line 45.
BEGIN failed--compilation aborted at mysqltuner.pl line 45.

Solution:

  1. Download the Cygwin installation file setup-x86_64.exe from Cygwin Installation
  2. Install the perl_pods package using either method below:

Method 1: Using Cygwin Setup Window (GUI)

  1. Double-click setup-x86_64.exe to launch the setup wizard
  2. Follow the installation wizard until you reach the "Select Packages" screen
  3. If the view dropdown shows "Pending", change it to "Full" to see all available packages
  4. Search for "perl_pods" in the search box
  5. Click on the "Skip" text next to perl_pods to change it to the version number (this selects it for installation)
  6. Click "Next" to proceed with the installation

Method 2: Using Command Line (CMD)[1][2]

  1. Open a command line window
  2. Navigate to the directory containing setup-x86_64.exe, for example: cd C:\Downloads, then press Enter
  3. Enter the following command: setup-x86_64.exe -q -P "perl_pods"

Environment:

  • Windows 2008 R2 standard
  • Cygwin version: CYGWIN_NT-6.1 Win2008R2-0-0 2.9.0(0.318/5/3) 2017-09-12 10:18 x86_64 Cygwin (information returned from uname -a)

How to resolve: (Cygwin) wget command not found[edit]

Condition: When I tried to download the MySQLTuner using wget command but met the error.

Solution:

  1. Download the installation file setup-x86_64.exe of Cygwin from Cygwin Installation
  2. Open the command line window
  3. Change to the directory where the file setup-x86_64.exe located e.g. cd C:\Downloads> and than press the key Enter
  4. To install the packages: wget. Keyin setup-x86_64.exe -q -P "wget" or follow the steps on terminal - WGET Command Not Working in Cygwin - Super User if you prefer the GUI window.

How to resolve: (Cygwin) unzip: command not found[edit]

Condition:

$ unzip -l sysschema.zip
-bash: unzip: command not found

Solution:

  1. Download the installation file setup-x86_64.exe of Cygwin from Cygwin Installation
  2. Open the command line window
  3. Change to the directory where the file setup-x86_64.exe located e.g. cd C:\Downloads> and than press the key Enter
  4. To install the packages: unzip. Keyin setup-x86_64.exe -q -P unzip

How to resolve: Attempted to use login credentials, but they were invalid.[edit]

Condition:

$ perl mysqltuner.pl
 >>  MySQLTuner 1.7.5 - Major Hayden <[email protected]>
 >>  Bug reports, feature requests, and downloads at http://mysqltuner.com/
 >>  Run with '--help' for additional options and output filtering
Please enter your MySQL administrative login: root
Please enter your MySQL administrative password: [!!] Attempted to use login credentials, but they were invalid.

Solution:

  • Specify the host parameter to command line e.g. perl mysqltuner.pl --host 127.0.0.1
  • Check the typo of mysql account and password

How to resolve: Performance schema should be activated for better diagnostics[edit]

Condition:

$ perl mysqltuner.pl
-------- Recommendations ---------------------------------------------------------------------------
General recommendations:
    Performance schema should be activated for better diagnostics

Solution:

  • Verify the MySQL setting. Execute the SQL query SHOW VARIABLES LIKE 'performance_schema'. The result should be OFF.
  • Stop the MySQL service.
  • Open the MySQL configuration file named my.ini on Win   or my.cnf on Linux   The file maybe located in different path e.g. C:\xampp\mysql\bin\my.ini on Win  
  • Edit the MySQL configuration file
[mysqld]
performance_schema = ON
  • Restart the MySQL service.
  • Verify the MySQL setting again. Execute the SQL query SHOW VARIABLES LIKE 'performance_schema'. The result should be ON.

References[edit]