Monday, December 5, 2016

Fixing mysqltuner ERROR 1054 on Ubuntu Server 16.04

After installing mysql-server and mysqltuner through the default repositories on my Ubuntu Server 16.04 machine, I got this error:
ERROR 1054 (42S22) at line 1: Unknown column 'password' in 'where clause'
This is a known bug that was introduced when mysql changed the name of the 'password' column. There has been a bug report on mysqltuner's github page and the appropriate fixes have been committed, however the debian package still has not been updated to reflect the current changes. To fix this I cloned the current git source and symlinked /usr/bin/mysqltuner to my source tree's mysqltuner.pl. This has the added benefit of when the package is updated, it will replace the symlink and not mess with any file installed by the package.
To do this, type the following commands:
cd /opt
git clone https://github.com/major/MySQLTuner-perl.git
cd MySQLTuner-perl
sudo mv /usr/bin/mysqltuner /usr/bin/mysqltuner.bak # back up the file just in case we mess up
sudo ln -s /opt/MySQLTuner-perl/mysqltuner.pl /usr/bin/mysqltuner

1 comment: