How can i disable MySQL strict mode ?

MySQL strict mode is enabled by default. You can disable it by couple of ways.


1. To Disable Strict Mode via SQL :

      You can disable strict mode on your MySQL server by running the following command on your Linode’s command line :

mysql -u root -p -e "SET GLOBAL sql_mode = ’NO_ENGINE_SUBSTITUTION’;"

You can set other values for sql_mode as well. See  sysvar sql_mode in the MySQL Documentation for a list.

      Then, you can verify that the mode is set by running the following :

mysql -u root -p -e "SELECT @@GLOBAL.sql_mode;"

2. Disable Strict Mode via my.cnf:
    Disable it by setting your own SQL_MODE in the my.cnf file, then restart MySQL.
The my.cnf file can be found in one of a few locations (depending on which distribution you’re using). The most common locations are /etc/my.cnf and /etc/mysql/my.cnf.
Inside my.cnf, look for a heading like [mysqld] and then look for the value of sql_mode. It might look like this (the actual value of sql_mode may vary):


You can change the value of sql_mode to NO_ENGINE_SUBSTITUTION to completely disable strict mode, but you may want to look up each mode that is configured before disabling it.
If sql_mode isn't set, you can add it under the [mysqld] heading, then save the file, and restart MySQL.

5 (1)
Article Rating (1 Votes)
Rate this article
    Attached Files
    There are no attachments for this article.
    Related Articles RSS Feed
    Configure ssh certificate based authentication
    Viewed 217 times since Fri, Apr 17, 2020
    Custom private key / public key pair in ssh gateway Solution
    Viewed 2674 times since Thu, Jun 15, 2017
    Can we map existing user group in ldap to ezeelogin as ezeelogin user group ?
    Viewed 3816 times since Mon, Sep 25, 2017
    Intergrate Okta SSO with jumpserver
    Viewed 261 times since Fri, Aug 9, 2019
    cron for changing root passwords on servers periodically
    Viewed 2763 times since Thu, Jun 15, 2017
    what port should i open on my server firewall to fetch ezeelogin license?
    Viewed 2816 times since Wed, Aug 16, 2017
    How do i configure Ezeelogin to authenticate using OpenLdap(Pam-Ldap) in centos ?
    Viewed 3809 times since Mon, Feb 5, 2018
    Intergrate OneLogin SSO with jumpserver
    Viewed 394 times since Wed, Aug 14, 2019
    add amazon ec2 in jump server or aws jumpbox
    Viewed 3158 times since Tue, May 8, 2018
    Integrate OpenLdap / Windows Active Directory ( AD ) authentication in ezeelogin jump server (Centos &Ubuntu)
    Viewed 6382 times since Thu, Jun 15, 2017