{"id":171,"date":"2018-04-12T09:26:54","date_gmt":"2018-04-12T13:26:54","guid":{"rendered":"http:\/\/blog.canscans.com\/?p=171"},"modified":"2018-04-12T09:26:54","modified_gmt":"2018-04-12T13:26:54","slug":"db-how-to-disable-mysql-strict-mode","status":"publish","type":"post","link":"https:\/\/waterloobae.com\/blog\/2018\/04\/12\/db-how-to-disable-mysql-strict-mode\/","title":{"rendered":"[DB] How to Disable MySQL Strict Mode"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\">What is Strict Mode?<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">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.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Why to Disable?<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">If you do not disable the strict mode, you may encounter errors while using the script.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">How to determine<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">the current global or session sql_mode setting? Select its value:<\/p>\n\n\n\n<pre class=\"wp-block-syntaxhighlighter-code\">SELECT @@GLOBAL.sql_mode; \nSELECT @@SESSION.sql_mode;<\/pre>\n\n\n\n<h1 class=\"wp-block-heading\">How to Change or Set the SQL mode?<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Method 1<\/strong>: Set the global or session sql_mode system variable using a SET statement:<\/p>\n\n\n\n<pre class=\"wp-block-syntaxhighlighter-code\">SET GLOBAL sql_mode = 'modes'; \nSET SESSION sql_mode = 'modes';<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Method 2<\/strong>: Edit &#8220;sql-mode&#8221; value in MySQL configuration file (my.ini or my.cnf):<\/p>\n\n\n\n<pre class=\"wp-block-syntaxhighlighter-code\">[mysqld] \nsql_mode=\"modes\"<\/pre>\n\n\n\n<h1 class=\"wp-block-heading\">How to Disable or Turn off Strict Mode?<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Method 1<\/strong>:&nbsp;Reset the global or session sql_mode system variable using a SET statement:<\/p>\n\n\n\n<pre class=\"wp-block-syntaxhighlighter-code\">SET GLOBAL sql_mode = ''; \nSET SESSION sql_mode = '';<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Method 2<\/strong>:&nbsp;Delete &#8220;sql-mode&#8221; value in MySQL configuration file (my.ini or my.cnf):<\/p>\n\n\n\n<pre class=\"wp-block-syntaxhighlighter-code\">[mysqld] \nsql_mode=\"\"<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>What is 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. Why to Disable? If you do not disable the strict mode, you may encounter errors while using the script. How to determine the current global [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-171","post","type-post","status-publish","format-standard","hentry","category-it-tips"],"_links":{"self":[{"href":"https:\/\/waterloobae.com\/blog\/wp-json\/wp\/v2\/posts\/171","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/waterloobae.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/waterloobae.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/waterloobae.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/waterloobae.com\/blog\/wp-json\/wp\/v2\/comments?post=171"}],"version-history":[{"count":0,"href":"https:\/\/waterloobae.com\/blog\/wp-json\/wp\/v2\/posts\/171\/revisions"}],"wp:attachment":[{"href":"https:\/\/waterloobae.com\/blog\/wp-json\/wp\/v2\/media?parent=171"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/waterloobae.com\/blog\/wp-json\/wp\/v2\/categories?post=171"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/waterloobae.com\/blog\/wp-json\/wp\/v2\/tags?post=171"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}