MySQLTuner - Not enough privileges for running

297 views
Skip to first unread message

Francois Lachance

unread,
Nov 1, 2018, 4:08:20 PM11/1/18
to security-onion
Wes,

I think that your updated documentation is missing the --defaults-config parameter. Your example probably should read:

sudo ./mysqltuner.pl --defaults-file=/etc/mysql/debian.cnf

Running that command tells me that "You probably did not get enough privileges for running MySQLTuner ...". Here is the output with verbose and debug turned on:

>> MySQLTuner 1.7.13 - Major Hayden <ma...@mhtx.net>
>> Bug reports, feature requests, and downloads at http://mysqltuner.com/
>> Run with '--help' for additional options and output filtering
[DG] /usr/bin/curl is available.
[DG] /usr/bin/curl -m 3 -silent 'https://raw.githubusercontent.com/major/MySQLTuner-perl/master/mysqltuner.pl' 2>/dev/null | grep 'my $tunerversion'| cut -d\" -f2
[DG] VERSION: 1.7.13
[DG] Remote data: 1.7.13
[OK] You have the latest version of MySQLTuner(1.7.13)
[DG] MySQL Client: /usr/bin/mysql would have been started with the following arguments:


[DG] MySQL Client: /usr/bin/mysql
[DG] defaults file detected: /etc/mysql/debian.cnf
[DG] MySQL Client Default File: /etc/mysql/debian.cnf
[DG] MySQL FINAL Client : /usr/bin/mysql --defaults-file=/etc/mysql/debian.cnf
[DG] MySQL Admin FINAL Client : /usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf
[DG] Physical Memory: 67318554624
[DG] Swap Memory: 1023406080
[DG] PERFORM: SELECT VERSION()
[!!] failed to execute: SELECT VERSION()
[!!] FAIL Execute SQL / return code: 256
[DG] CMD : /usr/bin/mysql
[DG] OPTIONS: --defaults-file=/etc/mysql/debian.cnf
[DG] ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

[DG] select_array: return code : 256
[!!] You probably did not get enough privileges for running MySQLTuner ...

Thanks,

Francois

Wes Lambert

unread,
Nov 1, 2018, 5:48:06 PM11/1/18
to securit...@googlegroups.com
Hi Francois,

Have you tried running it as documented?  It seems to work fine for me.  I believe --defaults-file=/etc/mysql/debian.cnf is assumed by default:

 sudo ./mysqltuner.pl
 >>  MySQLTuner 1.7.13 - Major Hayden <ma...@mhtx.net>
 >>  Bug reports, feature requests, and downloads at http://mysqltuner.com/
 >>  Run with '--help' for additional options and output filtering
[DG] /usr/bin/curl is available.
[DG] /usr/bin/curl -m 3 -silent 'https://raw.githubusercontent.com/major/MySQLTuner-perl/master/mysqltuner.pl' 2>/dev/null | grep 'my $tunerversion'| cut -d\" -f2
[DG] VERSION: 1.7.13
[DG] Remote data: 1.7.13
[OK] You have the latest version of MySQLTuner(1.7.13)
[DG] MySQL Client: /usr/bin/mysql would have been started with the following arguments:


[DG] MySQL Client: /usr/bin/mysql
[OK] Logged in using credentials from Debian maintenance account.
[DG] MySQL FINAL Client : /usr/bin/mysql --defaults-file=/etc/mysql/debian.cnf
[DG] MySQL Admin FINAL Client : /usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf
[DG] Physical Memory: 8339910656
[DG] Swap Memory: 1022357504
[DG] PERFORM: SELECT VERSION()
[DG] select_array: return code : 0
[DG] VERSION: 5.7.23
[DG] PERFORM: SHOW VARIABLES
[DG] select_array: return code : 0
[DG] PERFORM: SHOW GLOBAL VARIABLES
[DG] select_array: return code : 0
[DG] V: auto_increment_increment = 1
[DG] V: auto_increment_offset = 1
[DG] V: autocommit = ON

Thanks,
Wes

--
Follow Security Onion on Twitter!
https://twitter.com/securityonion
---
You received this message because you are subscribed to the Google Groups "security-onion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to security-onio...@googlegroups.com.
To post to this group, send email to securit...@googlegroups.com.
Visit this group at https://groups.google.com/group/security-onion.
For more options, visit https://groups.google.com/d/optout.


--

Francois Lachance

unread,
Nov 1, 2018, 6:20:29 PM11/1/18
to security-onion
Wes,

I indeed first tried without any parameters. Here's my output:

sudo ./mysqltuner.pl --verbose --debug
>> MySQLTuner 1.7.13 - Major Hayden <ma...@mhtx.net>
>> Bug reports, feature requests, and downloads at http://mysqltuner.com/
>> Run with '--help' for additional options and output filtering
[DG] /usr/bin/curl is available.
[DG] /usr/bin/curl -m 3 -silent 'https://raw.githubusercontent.com/major/MySQLTuner-perl/master/mysqltuner.pl' 2>/dev/null | grep 'my $tunerversion'| cut -d\" -f2
[DG] VERSION: 1.7.13
[DG] Remote data: 1.7.13
[OK] You have the latest version of MySQLTuner(1.7.13)
[DG] MySQL Client: /usr/bin/mysql would have been started with the following arguments:


[DG] MySQL Client: /usr/bin/mysql
[!!] Attempted to use login credentials from Debian maintenance account, but they failed.

Thanks,

Francois

Wes Lambert

unread,
Nov 5, 2018, 1:30:52 PM11/5/18
to securit...@googlegroups.com
Hi Francois,

I'm not sure why this is working for you at the moment.  This is something I would have to research further..

Thanks,
Wes

Wes Lambert

unread,
Nov 5, 2018, 1:51:27 PM11/5/18
to securit...@googlegroups.com
Francois,

Out of curiosity, could you remind me if this was from a clean install, or was this install upgraded from 14.04 to 16.04?  Also, have you manually modified any MySQL settings?

You may try the following steps to see if they help:


Thanks,
Wes

Francois Lachance

unread,
Nov 6, 2018, 2:41:34 PM11/6/18
to security-onion
This is from a clean install (was not an upgrade from 14.04). I did not modify any MySQL settings.

I will be taking a closer look at the mysqltuner.pl script itself and maybe add a few print/debug statements to it to figure out what it's doing.

Thanks,

Francois
Reply all
Reply to author
Forward
0 new messages