MySQL Strict Mode - Disable Print

  • 0

Client query:
===================================================================================
Please off Mysql Strict mode.
===================================================================================

What is Mysql Strict mode?

Strict mode controls how MySQL handles invalid or missing values in data-change statements such as INSERT or UPDATE. A value can be invalid for several reasons. For statements such as SELECT that do not change data, invalid values generate a warning in strict mode, not an error.

Solution:

1) Login into the server via SSH with provided login credential.

2) Check if strict mode is enabled

$ SHOW VARIABLES LIKE 'sql_mode'; A table is displayed on the screen with some sql_mode values separated with commas as shown below. If you find a value like “STRICT_TRANS_TABLES”, then, MySQL strict mode is enabled.

3) The location of the MySQL configuration file is /etc/my.cnf and we will edit it by doing the following:

# vi /etc/my.cnf 

sql_mode=""

:wq

Note: Edit the sql_mode value within this file and remove any value it has.

4)Restart the MySQL service with the following command:

# /scripts/restartsrv_mysql

# systemctl restart mysqld

===================================================================================


Was this answer helpful?

« Back