WHMCS has a requirement of MySQL Strict Mode. The official documentation provides instructions on how to do this with WHM/cPanel. This article documents the process for a Virtualmin server.
The MySQL configuration file on an Ubuntu 18.04 Virtualmin server is at /etc/mysql/mysql.conf.d
and the file is called mysqld.cnf
. To edit with Midnight Commander:
mc -e /etc/mysql/mysql.conf.d/mysqld.cnf
The WHMCS documentation then instructs to add a line like so:
Before adding that line though, be aware of the current list of mode parameters. On a live server we found this:
mysql -uroot -p mysql> SHOW VARIABLES LIKE 'sql_mode'; +---------------+-------------------------------------------------------------------------------------------------------------------------------------------+ | Variable_name | Value | +---------------+-------------------------------------------------------------------------------------------------------------------------------------------+ | sql_mode | ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION | +---------------+-------------------------------------------------------------------------------------------------------------------------------------------+ 1 row in set (0.00 sec)
Once you’ve added that setting you end up like this:
mysql -uroot -p mysql> SHOW VARIABLES LIKE 'sql_mode'; +---------------+-------+ | Variable_name | Value | +---------------+-------+ | sql_mode | | +---------------+-------+ 1 row in set (0.00 sec)
Reference
https://help.whmcs.com/m/installation/l/678317-disabling-mysql-strict-mode