1292 – Incorrect date value: ‘0000-00-00’ for column ‘date’
You run into 1292 – Incorrect date value: ‘0000-00-00’ for column ‘date’ error because since version 5.7, MySQL enables SQL Strict Mode by default and does not permit ‘0000-00-00’ as a valid date value.
For more information check MySQL Documentation 5.7
Before we start
Apache Web Server
– Have you installed apache? Check out our article Install Apache on CentOS 7.
PHP
– Have you installed PHP? Check out our article Install PHP on CentOS.
MySQL
– Have you installed MySQL? Check out our article Install MySQL on CentOS 7.
Please follow the below step to fix this.
Solution 1
If you are using phpMyAdmin
1) Click on the variables menu in PHPMyAdmin
2) Find the sql_mode variable and edit this line.
3) Remove NO_ZERO_DATE from sql_mode
4) Save it.
Please check the below screenshot for a better understating.
Solution 2
- You can check the SQL mode from the MySQL using below query
SELECT @@GLOBAL.sql_mode global, @@SESSION.sql_mode SESSION
- So you can disable it by removing it from the MySQL configuration file, or run the below query.
SET GLOBAL sql_mode = '';
- Then restart the MySQL server and you should be able to use ‘0000-00-00’ as a value for the DATE column.
I hope it helped you to fix error 1292 – Incorrect date value: ‘0000-00-00’ for column ‘date’. Please let us know in the comment section if you have any concerns.
Thank You!
Thanks for your time, to know about me.
Hello I Am Vijay Poshiya. 🙂
Here’s My little description of your attention on Me and My blog. I am here to help you with PHP programming. I can give you a cake walkthrough platform where a complex program can make it easier for you. I will also provide you with the rare collections of task sets over the internet.
I hope you will find your solutions in better understanding shape within my blog.
You can read more about PHPAdvices at the “About” page.
Leave a Comment