Stuck with /usr/bin/mysql: Unknown Variable: Plesk Update Fail? We can help you.
As part of our Server Management Services, we assist our customers with several Plesk queries.
Today, let us see how our support techs fix this error for our customers.
/usr/bin/mysql: Unknown Variable: Plesk Update Fail
There are two symptoms of this failure. Let us first see that and later move on to the resolution.
Most often, we find the following in /var/log/plesk/install/plesk_18.0.*_installation.log:
/usr/bin/mysql: unknown variable ‘sql_mode=ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION’
In addition, any attempt to query the MySQL version fails with the same errors:
mysql -V /usr/bin/mysql: unknown variable ‘sql_mode=ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION’
The major cause of this failure can be deprecated MySQL variables specified in /etc/my.cnf:
ERROR_FOR_DIVISION_BY_ZERO is set by default since MySQL 10.2.4 NO_AUTO_CREATE_USER is also deprecated
Now that we have seen the symptoms and cause of this issue, we will now discuss how to fix this issue.
Moving ahead, let us see the steps our Support Techs employ, in order to fix this issue.
1. Initially, we connect to the Plesk server via SSH.
2. Then we remove the deprecated variables from the config file: /etc/my.cnf.
However, in Ubuntu/Debian we need to remove it from all files within /etc/mysql directory.
3. After that, we restart the MySQL service:
systemctl restart mariadb || systemctl restart mysqld
[Caught up in between? We’d be glad to be of assistance]
In short, most often we find this error due to deprecated MySQL variables specified in /etc/my.cnf: However, in this article, we saw how our Support Techs fix this in a quick and effective way.