{"id":28263,"date":"2017-11-30T13:41:13","date_gmt":"2017-11-30T11:41:13","guid":{"rendered":"https:\/\/mamchenkov.net\/wordpress\/?p=28263"},"modified":"2017-11-30T13:41:13","modified_gmt":"2017-11-30T11:41:13","slug":"change-sql-mode-for-mariadb-in-fedora-27","status":"publish","type":"post","link":"https:\/\/mamchenkov.net\/wordpress\/2017\/11\/30\/change-sql-mode-for-mariadb-in-fedora-27\/","title":{"rendered":"Change SQL mode for MariaDB in Fedora 27"},"content":{"rendered":"<!-- google_ad_section_start -->\n<p>After I upgraded my laptop to <a href=\"https:\/\/mamchenkov.net\/wordpress\/2017\/11\/15\/fedora-27\/\">Fedora 27<\/a>, I started experiencing some weird issues with most of the projects I am developing locally.\u00a0 Trying to save anything into the database that involves dates, started throwing the following errors:<\/p>\n<pre class=\"brush: plain; light: true; title: ; notranslate\" title=\"\">\r\nError:\u00a0SQLSTATE&#x5B;22007]: Invalid datetime format: 1292 Incorrect datetime value: '2017-11-30T13:30:48+02:00' for column 'timestamp' at row 1\r\n<\/pre>\n<p>A quick look around showed that Fedora 27 ships MariaDB v10.2, while the previous distribution version shipped MariaDB v10.1. Digging through <a href=\"https:\/\/mariadb.com\/kb\/en\/library\/changes-improvements-in-mariadb-102\/\">the changes between the two versions<\/a> didn&#8217;t help much, even though there is slight mention of the related change.<\/p>\n<blockquote><p>SQL_MODE has been changed; in particular, NOT NULL fields with no default will no longer fall back to a dummy value for inserts which do not specify a value for that field.<\/p><\/blockquote>\n<p><a href=\"https:\/\/stackoverflow.com\/\">StackOverflow<\/a> is much more helpful, as always.\u00a0 These two threads &#8211; <a href=\"https:\/\/stackoverflow.com\/questions\/35565128\/mysql-incorrect-datetime-value-0000-00-00-000000\/37780259\">one<\/a> and <a href=\"https:\/\/stackoverflow.com\/questions\/3891896\/blocking-0000-00-00-from-mysql-date-fields\">two<\/a> &#8211; in particular, explained the changes and suggested the fix.\u00a0 I had to either fix the projects I was working on, or modify my local configuration to use the old SQL mode.\u00a0 <a href=\"https:\/\/stackoverflow.com\/questions\/28849293\/how-to-make-sql-mode-no-engine-substitution-permanent-in-mysql-my-cnf\">This thread<\/a> provided some more details, so the final solution was adding the following to the <em>\/etc\/my.cnf<\/em> and restarting the MariaDB service:<\/p>\n<pre class=\"brush: plain; light: true; title: ; notranslate\" title=\"\">\r\n&#x5B;mysqld]\r\nsql-mode=&quot;NO_ZERO_IN_DATE,NO_ZERO_DATE&quot;\r\n<\/pre>\n<p>And now we are back to normal.<\/p>\n<!-- google_ad_section_end -->\n","protected":false},"excerpt":{"rendered":"<!-- google_ad_section_start -->\n<p>After I upgraded my laptop to Fedora 27, I started experiencing some weird issues with most of the projects I am developing locally.\u00a0 Trying to save anything into the database that involves dates, started throwing the following errors: Error:\u00a0SQLSTATE&#x5B;22007]: Invalid datetime format: 1292 Incorrect datetime value: &#8216;2017-11-30T13:30:48+02:00&#8217; for column &#8216;timestamp&#8217; at row 1 A quick &hellip; <a href=\"https:\/\/mamchenkov.net\/wordpress\/2017\/11\/30\/change-sql-mode-for-mariadb-in-fedora-27\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Change SQL mode for MariaDB in Fedora 27<\/span><\/a><\/p>\n<!-- google_ad_section_end -->\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"Change SQL mode for MariaDB in Fedora 27 #Linux #Fedora #MySQL #WebDev #databases","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_links_to":"","_links_to_target":""},"categories":[1,6,18,133,62,1334],"tags":[1559,2351,3066,1330],"keyring_services":[],"class_list":["post-28263","post","type-post","status-publish","format-standard","hentry","category-general","category-linux","category-programming","category-sysadmin","category-technology","category-web-work","tag-databases","tag-fedora-linux","tag-mysql","tag-web-development"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":18039,"url":"https:\/\/mamchenkov.net\/wordpress\/2013\/04\/19\/fedora-19-alpha-is-a-go\/","url_meta":{"origin":28263,"position":0},"title":"Fedora 19 alpha is a Go","author":"Leonid Mamchenkov","date":"April 19, 2013","format":false,"excerpt":"Fedora 19 alpha version will be released next Tuesday. \u00a0I've been busy with other things recently, so that was a surprising announcement for me. Is it that time of the year again? \u00a0Apparently. \u00a0We are still a good three month away from the final release, but it's still good to\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":28186,"url":"https:\/\/mamchenkov.net\/wordpress\/2017\/11\/06\/mysql-vs-mariadb-reality-check\/","url_meta":{"origin":28263,"position":1},"title":"MySQL vs. MariaDB: Reality Check","author":"Leonid Mamchenkov","date":"November 6, 2017","format":false,"excerpt":"Percona Database Performance Blog runs this post -\u00a0MySQL vs. MariaDB: Reality Check - comparing the MySQL, MariaDB and the Percona Server for MySQL.\u00a0 I think that most people using MySQL or MariaDB today consider them to be pretty much identical (a fork for legal reasons or something along those lines).\u00a0\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":28909,"url":"https:\/\/mamchenkov.net\/wordpress\/2018\/11\/04\/mycli-mysql-command-line-client-with-auto-completion\/","url_meta":{"origin":28263,"position":2},"title":"mycli &#8211; MySQL command line client with auto-completion","author":"Leonid Mamchenkov","date":"November 4, 2018","format":false,"excerpt":"mycli is a MySQL \/ MariaDB \/ Pecona database command line client with syntax highlighting and auto-completion.\u00a0 Have a look at some of the screenshots and documentation for features. Found via this StackOverflow discussion.","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2018\/11\/mycli-500x181.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":24870,"url":"https:\/\/mamchenkov.net\/wordpress\/2015\/10\/20\/6-great-monospaced-fonts-for-code-and-terminal-in-fedora\/","url_meta":{"origin":28263,"position":3},"title":"6 great monospaced fonts for code and terminal in Fedora","author":"Leonid Mamchenkov","date":"October 20, 2015","format":false,"excerpt":"Fedora Magazine covers \"6 great monospaced fonts for code and terminal in Fedora\". \u00a0Their choices are: Hack Inconsolata Source Code Pro Fira Mono Droid Sans Mono DejaVu Sans Mono It's been a while since I considered a change to the monospaced fonts that I'm using. \u00a0The top three fonts in\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"hack","src":"https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2015\/10\/hack-500x220.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":24075,"url":"https:\/\/mamchenkov.net\/wordpress\/2015\/05\/08\/do-not-use-amazon-linux\/","url_meta":{"origin":28263,"position":4},"title":"Do Not Use Amazon Linux","author":"Leonid Mamchenkov","date":"May 8, 2015","format":false,"excerpt":"I came across \"Do Not Use Amazon Linux\" opinion on Ex Ratione. \u00a0I have to say that I mostly agree with it. \u00a0When I initially started using Amazon Web Services, I assumed (due to time constraints mostly) that Amazon Linux was a close derivative of CentOs and I opted for\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":10361,"url":"https:\/\/mamchenkov.net\/wordpress\/2006\/08\/17\/women-and-usability-at-fedora\/","url_meta":{"origin":28263,"position":5},"title":"Women and Usability at Fedora","author":"Leonid Mamchenkov","date":"August 17, 2006","format":false,"excerpt":"Fedora Project has focused on a couple of important issues recently - women and usability. Both are indeed important and will make Fedora Linux better for all of us. On the other hand, I wonder, if there is even more usable and friendly way to start web browser. Because with\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_sharing_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts\/28263","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/comments?post=28263"}],"version-history":[{"count":0,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts\/28263\/revisions"}],"wp:attachment":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/media?parent=28263"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/categories?post=28263"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/tags?post=28263"},{"taxonomy":"keyring_services","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/keyring_services?post=28263"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}