Newly built Virtualmin servers always give the following notice on attempt to save the database root password:
The MySQL client program /usr/bin/mysql does not accept passwords passed using the MYSQL_PWD environment variable. To ensure that Webmin is able to fully communicate with MySQL, this option should be turned off on the module configuration page.
and it is so inconvenient to change that setting manually every single time. Unfortunately, this setting is not stored together with Virtualmin configuration backup (webmin/virtual-server/config
), because it resides in different file /etc/webmin/mysql/config
. So to save it once and then just restore Virtualmin's settings on a new server won't work. So you have to probably backup the database settings through Webmin.
However, it would be much nicer if Virtualmin did configure necessary setting during its setup, so users don't have to meddle with backing up and restoring.
Comments
Submitted by JamieCameron on Fri, 04/27/2018 - 22:54 Comment #1
It's odd that this is required though, as the
mysql
command should accept passwords via MYSQL_PWD.Which mysql version are you running there?
Submitted by yngens on Sun, 04/29/2018 - 21:57 Comment #2
It is
mysql Ver 15.1 Distrib 5.5.56-MariaDB, for Linux (x86_64) using readline 5.1
. Please test it with CentOS 7.x and it will always output that error.Submitted by JamieCameron on Sun, 04/29/2018 - 22:13 Comment #3
Check that the
/root/.my.cnf
file doesn't contain apassword
line - because this overrides theMYSQL_PWD
environment variable, it isn't compatible with Webmin.Submitted by yngens on Mon, 04/30/2018 - 22:08 Comment #4
Hm, that's the culprit then, because that file does have password set. But then either this should be documented and probably reflected in the error message not to confuse users or, ideally, addressed so it becomes compatible.
Submitted by JamieCameron on Tue, 05/01/2018 - 15:29 Comment #5
I'll update the error message to make the cause of this clearer.
Submitted by IssueBot on Thu, 10/11/2018 - 20:07 Comment #6
Automatically closed - issue fixed for 2 weeks with no activity.