MariaDB: my.cnf settings cause mysql commands to error out

in my /etc/my.cnf file i have, under the [client-server] section, the following:

sql_mode=NO_ENGINE_SUBSTITUTION

when i try to run any mysql commands, such as mysqldunmp or even mysql --help, i get the following error:

mysql: unknown variable 'sql_mode=NO_ENGINE_SUBSTITUTION'

i understand that mysql ignores [client] settings in my.cnf (as per this post), but i see nowhere where this is the case for the [client-server] settings. personally, i've never seen this before, but assume the previous admin knew what he was doing since everything, operationally, is running tickety-boo.

at any rate, can someone kindly suggest how to remedy this as it is preventing any terminal-based commands from executing... which apparently includes cron scripts... :P


Options inside the [client-server] option group get interpreted by client tools like mysql and mysqldump as well as the mysql/mariadb server. Since sql_mode is a server-only option you should:

  • remove the option from the [client-server] group
  • add the option to the [mysqld] group

see also: https://mariadb.com/kb/en/sql-mode/