Start a conversation

Disabling MySQL Strict Mode on the Server

Overview

MySQL Strict Mode controls how invalid or missing values in data changing queries are handled. This includes INSERT, UPDATE and CREATE TABLE statements. With MySQL Strict Mode enabled, which is the default state, invalid or missing data may cause warnings or errors when attempting to process the query.

When Strict Mode is disabled, the same query would have its invalid or missing values adjusted and would produce a simple warning. This may seem like the preferred result; however, with Strict Mode disabled, specific actions may cause unexpected results. For instance, when the value being inserted exceeds the maximum character limit, it will be truncated to fit the limit.

To avoid any issues running Kayako Classic on your server, you need to disable the Strict Mode in your MySQL database. This article provides the instructions to make changes to the configuration to disable the Strict Mode.

Solution

  1. Open the  my.ini or my.cnf file for editing (the file you have depends on whether you are running Windows or Linux).
     
  2. Find the following line:
    sql_mode = "STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

  3. Replace it with the line below:

    • If the line is not found, insert the line under the [mysqld] section (if there is no [mysqld] section, create it).

      sql_mode= ""
  4. Restart the MySQL service for the change to take effect.

    • If restarting is not a feasible option at the moment, you may log into the database server and execute the below command for the changes to take effect immediately. However, the change will be discarded the next time the MySQL service restarts unless the above process is performed.

      set global sql_mode='';
  5. To confirm strict mode has been successfully disabled, one can execute the SELECT @@sql_mode query in the DB.

    • If the 'STRICT_TRANS_TABLES' value is still present, it is likely the configuration file was not properly updated, and it might be necessary to recreate it.
Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. Priyanka Bhotika

  2. Posted

Comments