skip to Main Content

hi i need to disable strict mode in mariadb even adding via my.cnf but its not working i did the following

SET sql_mode = '';
SET GLOBAL sql_mode = '';

output and then i restared mariadb

+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| sql_mode      |       |
+---------------+-------+

os : CentOs 7
db : maraidb 10.4

update even after adding in the my.cnf its not working getting this in ssh

mysql: unknown variable 'sql_mode=NO_ENGINE_SUBSTITUTION'

2

Answers


  1. You need to edit your my.cnf file via SSH

    /etc/my.cnf
    

    Add following line in it

    sql_mode=NO_ENGINE_SUBSTITUTION
    

    now restart MariaDB

    Login or Signup to reply.
  2. The error message is thrown by the command line client, since the variable sql_mode is a server variable.

    To fix that, you have the following options:

    1) If you have the permissions to edit the server configuration, and the sql_mode should be set for all connections, add the following to the server section of my.cnf

    [mysqld]
    sql_mode=NO_ENGINE_SUBSTITUTION
    

    2) If you want to enable it by client, add the following line in the client section of your my.cnf

    [mysql]
    init-command=SET SQL_MODE="NO_ENGINE_SUBSTITUTION"
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search