{"id":15,"date":"2020-11-09T15:38:07","date_gmt":"2020-11-09T15:38:07","guid":{"rendered":"https:\/\/manishshrivastava.com\/blog\/?p=15"},"modified":"2020-11-09T15:38:09","modified_gmt":"2020-11-09T15:38:09","slug":"solved-incorrect-datetime-value-0000-00-00-000000-for-column","status":"publish","type":"post","link":"https:\/\/manishshrivastava.com\/blog\/solved-incorrect-datetime-value-0000-00-00-000000-for-column\/","title":{"rendered":"[Solved]: Incorrect datetime value: &#8216;0000-00-00 00:00:00&#8217; for column"},"content":{"rendered":"\n<p><strong>Problem faced<\/strong>: Incorrect datetime value: &#8216;0000-00-00 00:00:00&#8217; for column.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"1024\" height=\"46\" src=\"https:\/\/manishshrivastava.com\/blog\/wp-content\/uploads\/2020\/11\/Screenshot-from-2020-11-07-16-54-52-1024x46.png\" alt=\"\" class=\"wp-image-20\" srcset=\"https:\/\/manishshrivastava.com\/blog\/wp-content\/uploads\/2020\/11\/Screenshot-from-2020-11-07-16-54-52-1024x46.png 1024w, https:\/\/manishshrivastava.com\/blog\/wp-content\/uploads\/2020\/11\/Screenshot-from-2020-11-07-16-54-52-300x14.png 300w, https:\/\/manishshrivastava.com\/blog\/wp-content\/uploads\/2020\/11\/Screenshot-from-2020-11-07-16-54-52-768x35.png 768w, https:\/\/manishshrivastava.com\/blog\/wp-content\/uploads\/2020\/11\/Screenshot-from-2020-11-07-16-54-52-1170x53.png 1170w, https:\/\/manishshrivastava.com\/blog\/wp-content\/uploads\/2020\/11\/Screenshot-from-2020-11-07-16-54-52.png 1304w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong>Solution:<\/strong> The best way to do this is to export the <a href=\"https:\/\/dev.mysql.com\/doc\/refman\/8.0\/en\/mysqldump.html\" target=\"_blank\" rel=\"noreferrer noopener\">MySQL dump<\/a> file using below command from the database.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">mysqldump -uroot -ppasswordname databasename > database_name.sql<\/code><\/pre>\n\n\n\n<p>Now, you have `<code>database_name.sql` and try to open the file and search the string `0000-00-00 00:00:00<\/code>` and replace it with `CURRENT_TIMESTAMP`. You can do that with below command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">sed -i.bu 's\/'\\''0000-00-00 00:00:00'\\''\/CURRENT_TIMESTAMP\/g' database_name.sql<\/code><\/pre>\n\n\n\n<p>Once in your file when you replaced all <code>`0000-00-00 00:00:00<\/code>` with `<a href=\"https:\/\/www.w3resource.com\/mysql\/date-and-time-functions\/mysql-current_timestamp-function.php#:~:text=MySQL%20CURRENT_TIMESTAMP()%20function&amp;text=In%20MySQL%2C%20the%20CURRENT_TIMESTAMP%20returns,are%20the%20synonym%20of%20CURRENT_TIMESTAMP.\" target=\"_blank\" rel=\"noreferrer noopener\">CURRENT_TIMESTAMP<\/a>`. You can import that into new separate MySQL 5.7 installed separately successfully. <\/p>\n\n\n\n<p>However, there are different <a href=\"https:\/\/stackoverflow.com\/questions\/35565128\/mysql-incorrect-datetime-value-0000-00-00-000000\" target=\"_blank\" rel=\"noreferrer noopener\">suggestion at stackoverflow<\/a>. You can go  through this if you need.<\/p>\n\n\n\n<p>That&#8217;t it. You can test that and let me know if anything. <\/p>\n\n\n\n<p>Cheers <\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Problem faced: Incorrect datetime value: &#8216;0000-00-00 00:00:00&#8217; for column. Solution: The best way to do this is to export the MySQL dump file using below command from the database. Now, you have `database_name.sql` and try to open the file and search the string `0000-00-00 00:00:00` and replace it with `CURRENT_TIMESTAMP`. You can do that with &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/manishshrivastava.com\/blog\/solved-incorrect-datetime-value-0000-00-00-000000-for-column\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;[Solved]: Incorrect datetime value: &#8216;0000-00-00 00:00:00&#8217; for column&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2,3],"tags":[5,4,6],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.8.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>[Solved]: Incorrect datetime value: &#039;0000-00-00 00:00:00&#039; for column - Manish Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/manishshrivastava.com\/blog\/solved-incorrect-datetime-value-0000-00-00-000000-for-column\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"[Solved]: Incorrect datetime value: &#039;0000-00-00 00:00:00&#039; for column - Manish Blog\" \/>\n<meta property=\"og:description\" content=\"Problem faced: Incorrect datetime value: &#8216;0000-00-00 00:00:00&#8217; for column. Solution: The best way to do this is to export the MySQL dump file using below command from the database. Now, you have `database_name.sql` and try to open the file and search the string `0000-00-00 00:00:00` and replace it with `CURRENT_TIMESTAMP`. You can do that with &hellip; Continue reading &quot;[Solved]: Incorrect datetime value: &#8216;0000-00-00 00:00:00&#8217; for column&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/manishshrivastava.com\/blog\/solved-incorrect-datetime-value-0000-00-00-000000-for-column\/\" \/>\n<meta property=\"og:site_name\" content=\"Manish Blog\" \/>\n<meta property=\"article:published_time\" content=\"2020-11-09T15:38:07+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-11-09T15:38:09+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/manishshrivastava.com\/blog\/wp-content\/uploads\/2020\/11\/Screenshot-from-2020-11-07-16-54-52-1024x46.png\" \/>\n<meta name=\"author\" content=\"manishshrivastava\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"manishshrivastava\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/manishshrivastava.com\/blog\/solved-incorrect-datetime-value-0000-00-00-000000-for-column\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/manishshrivastava.com\/blog\/solved-incorrect-datetime-value-0000-00-00-000000-for-column\/\"},\"author\":{\"name\":\"manishshrivastava\",\"@id\":\"https:\/\/manishshrivastava.com\/blog\/#\/schema\/person\/e4d02d0fe4a05267401de130fac850f0\"},\"headline\":\"[Solved]: Incorrect datetime value: &#8216;0000-00-00 00:00:00&#8217; for column\",\"datePublished\":\"2020-11-09T15:38:07+00:00\",\"dateModified\":\"2020-11-09T15:38:09+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/manishshrivastava.com\/blog\/solved-incorrect-datetime-value-0000-00-00-000000-for-column\/\"},\"wordCount\":107,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/manishshrivastava.com\/blog\/#\/schema\/person\/19d0df1c38b86606412b5c821e67e67e\"},\"keywords\":[\"5.7\",\"mysql\",\"upgrade\"],\"articleSection\":[\"mysql\",\"upgrade\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/manishshrivastava.com\/blog\/solved-incorrect-datetime-value-0000-00-00-000000-for-column\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/manishshrivastava.com\/blog\/solved-incorrect-datetime-value-0000-00-00-000000-for-column\/\",\"url\":\"https:\/\/manishshrivastava.com\/blog\/solved-incorrect-datetime-value-0000-00-00-000000-for-column\/\",\"name\":\"[Solved]: Incorrect datetime value: '0000-00-00 00:00:00' for column - Manish Blog\",\"isPartOf\":{\"@id\":\"https:\/\/manishshrivastava.com\/blog\/#website\"},\"datePublished\":\"2020-11-09T15:38:07+00:00\",\"dateModified\":\"2020-11-09T15:38:09+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/manishshrivastava.com\/blog\/solved-incorrect-datetime-value-0000-00-00-000000-for-column\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/manishshrivastava.com\/blog\/solved-incorrect-datetime-value-0000-00-00-000000-for-column\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/manishshrivastava.com\/blog\/solved-incorrect-datetime-value-0000-00-00-000000-for-column\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/manishshrivastava.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"mysql\",\"item\":\"https:\/\/manishshrivastava.com\/blog\/category\/mysql\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"[Solved]: Incorrect datetime value: &#8216;0000-00-00 00:00:00&#8217; for column\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/manishshrivastava.com\/blog\/#website\",\"url\":\"https:\/\/manishshrivastava.com\/blog\/\",\"name\":\"Manish Blog\",\"description\":\"Rubyist, Realist, Pragmatist, and Believer\",\"publisher\":{\"@id\":\"https:\/\/manishshrivastava.com\/blog\/#\/schema\/person\/19d0df1c38b86606412b5c821e67e67e\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/manishshrivastava.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/manishshrivastava.com\/blog\/#\/schema\/person\/19d0df1c38b86606412b5c821e67e67e\",\"name\":\"manish shrivastava\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/manishshrivastava.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/8d35275f95d1cd3202c89c1693336453?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/8d35275f95d1cd3202c89c1693336453?s=96&d=mm&r=g\",\"caption\":\"manish shrivastava\"},\"logo\":{\"@id\":\"https:\/\/manishshrivastava.com\/blog\/#\/schema\/person\/image\/\"},\"sameAs\":[\"http:\/\/99interview.com\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/manishshrivastava.com\/blog\/#\/schema\/person\/e4d02d0fe4a05267401de130fac850f0\",\"name\":\"manishshrivastava\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/manishshrivastava.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/ba8ddd15351cbf6b58b3d8e16ce94b3b?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/ba8ddd15351cbf6b58b3d8e16ce94b3b?s=96&d=mm&r=g\",\"caption\":\"manishshrivastava\"},\"description\":\"Holds 15+ years of experience as a Software Development Expert. His vision is to share knowledge related to How Software can add value to anyone's life. Manish is a Software Developer and Open source contributor. He is an experienced developer with 15+ years of experience in creating awesome web and app projects based on specific requirements using Ruby, React, and sometimes python. He says, He is a Rubyist, Realist, Pragmatist, and Believer.\",\"sameAs\":[\"https:\/\/manishshrivastava.com\/blog\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"[Solved]: Incorrect datetime value: '0000-00-00 00:00:00' for column - Manish Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/manishshrivastava.com\/blog\/solved-incorrect-datetime-value-0000-00-00-000000-for-column\/","og_locale":"en_US","og_type":"article","og_title":"[Solved]: Incorrect datetime value: '0000-00-00 00:00:00' for column - Manish Blog","og_description":"Problem faced: Incorrect datetime value: &#8216;0000-00-00 00:00:00&#8217; for column. Solution: The best way to do this is to export the MySQL dump file using below command from the database. Now, you have `database_name.sql` and try to open the file and search the string `0000-00-00 00:00:00` and replace it with `CURRENT_TIMESTAMP`. You can do that with &hellip; Continue reading \"[Solved]: Incorrect datetime value: &#8216;0000-00-00 00:00:00&#8217; for column\"","og_url":"https:\/\/manishshrivastava.com\/blog\/solved-incorrect-datetime-value-0000-00-00-000000-for-column\/","og_site_name":"Manish Blog","article_published_time":"2020-11-09T15:38:07+00:00","article_modified_time":"2020-11-09T15:38:09+00:00","og_image":[{"url":"https:\/\/manishshrivastava.com\/blog\/wp-content\/uploads\/2020\/11\/Screenshot-from-2020-11-07-16-54-52-1024x46.png"}],"author":"manishshrivastava","twitter_card":"summary_large_image","twitter_misc":{"Written by":"manishshrivastava","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/manishshrivastava.com\/blog\/solved-incorrect-datetime-value-0000-00-00-000000-for-column\/#article","isPartOf":{"@id":"https:\/\/manishshrivastava.com\/blog\/solved-incorrect-datetime-value-0000-00-00-000000-for-column\/"},"author":{"name":"manishshrivastava","@id":"https:\/\/manishshrivastava.com\/blog\/#\/schema\/person\/e4d02d0fe4a05267401de130fac850f0"},"headline":"[Solved]: Incorrect datetime value: &#8216;0000-00-00 00:00:00&#8217; for column","datePublished":"2020-11-09T15:38:07+00:00","dateModified":"2020-11-09T15:38:09+00:00","mainEntityOfPage":{"@id":"https:\/\/manishshrivastava.com\/blog\/solved-incorrect-datetime-value-0000-00-00-000000-for-column\/"},"wordCount":107,"commentCount":0,"publisher":{"@id":"https:\/\/manishshrivastava.com\/blog\/#\/schema\/person\/19d0df1c38b86606412b5c821e67e67e"},"keywords":["5.7","mysql","upgrade"],"articleSection":["mysql","upgrade"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/manishshrivastava.com\/blog\/solved-incorrect-datetime-value-0000-00-00-000000-for-column\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/manishshrivastava.com\/blog\/solved-incorrect-datetime-value-0000-00-00-000000-for-column\/","url":"https:\/\/manishshrivastava.com\/blog\/solved-incorrect-datetime-value-0000-00-00-000000-for-column\/","name":"[Solved]: Incorrect datetime value: '0000-00-00 00:00:00' for column - Manish Blog","isPartOf":{"@id":"https:\/\/manishshrivastava.com\/blog\/#website"},"datePublished":"2020-11-09T15:38:07+00:00","dateModified":"2020-11-09T15:38:09+00:00","breadcrumb":{"@id":"https:\/\/manishshrivastava.com\/blog\/solved-incorrect-datetime-value-0000-00-00-000000-for-column\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/manishshrivastava.com\/blog\/solved-incorrect-datetime-value-0000-00-00-000000-for-column\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/manishshrivastava.com\/blog\/solved-incorrect-datetime-value-0000-00-00-000000-for-column\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/manishshrivastava.com\/blog\/"},{"@type":"ListItem","position":2,"name":"mysql","item":"https:\/\/manishshrivastava.com\/blog\/category\/mysql\/"},{"@type":"ListItem","position":3,"name":"[Solved]: Incorrect datetime value: &#8216;0000-00-00 00:00:00&#8217; for column"}]},{"@type":"WebSite","@id":"https:\/\/manishshrivastava.com\/blog\/#website","url":"https:\/\/manishshrivastava.com\/blog\/","name":"Manish Blog","description":"Rubyist, Realist, Pragmatist, and Believer","publisher":{"@id":"https:\/\/manishshrivastava.com\/blog\/#\/schema\/person\/19d0df1c38b86606412b5c821e67e67e"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/manishshrivastava.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/manishshrivastava.com\/blog\/#\/schema\/person\/19d0df1c38b86606412b5c821e67e67e","name":"manish shrivastava","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/manishshrivastava.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/8d35275f95d1cd3202c89c1693336453?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/8d35275f95d1cd3202c89c1693336453?s=96&d=mm&r=g","caption":"manish shrivastava"},"logo":{"@id":"https:\/\/manishshrivastava.com\/blog\/#\/schema\/person\/image\/"},"sameAs":["http:\/\/99interview.com"]},{"@type":"Person","@id":"https:\/\/manishshrivastava.com\/blog\/#\/schema\/person\/e4d02d0fe4a05267401de130fac850f0","name":"manishshrivastava","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/manishshrivastava.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/ba8ddd15351cbf6b58b3d8e16ce94b3b?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ba8ddd15351cbf6b58b3d8e16ce94b3b?s=96&d=mm&r=g","caption":"manishshrivastava"},"description":"Holds 15+ years of experience as a Software Development Expert. His vision is to share knowledge related to How Software can add value to anyone's life. Manish is a Software Developer and Open source contributor. He is an experienced developer with 15+ years of experience in creating awesome web and app projects based on specific requirements using Ruby, React, and sometimes python. He says, He is a Rubyist, Realist, Pragmatist, and Believer.","sameAs":["https:\/\/manishshrivastava.com\/blog"]}]}},"_links":{"self":[{"href":"https:\/\/manishshrivastava.com\/blog\/wp-json\/wp\/v2\/posts\/15"}],"collection":[{"href":"https:\/\/manishshrivastava.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/manishshrivastava.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/manishshrivastava.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/manishshrivastava.com\/blog\/wp-json\/wp\/v2\/comments?post=15"}],"version-history":[{"count":10,"href":"https:\/\/manishshrivastava.com\/blog\/wp-json\/wp\/v2\/posts\/15\/revisions"}],"predecessor-version":[{"id":26,"href":"https:\/\/manishshrivastava.com\/blog\/wp-json\/wp\/v2\/posts\/15\/revisions\/26"}],"wp:attachment":[{"href":"https:\/\/manishshrivastava.com\/blog\/wp-json\/wp\/v2\/media?parent=15"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/manishshrivastava.com\/blog\/wp-json\/wp\/v2\/categories?post=15"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/manishshrivastava.com\/blog\/wp-json\/wp\/v2\/tags?post=15"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}