[mysql] #1292 - Incorrect date value: '0000-00-00'

I referenced many questions which have the same title as mine, but they have a different approach and different issue so this question is not a duplicate.

I have a table in which column fm_sctrdate is a date type and has the default value 0000-00-00.

enter image description here

Insertion by website is working fine but when I try to insert any value by phpmyadmin then I got following error.

enter image description here

Mysql version is 5.7.11. One more thing recently our server has been upgrade from mysqlnd 5.0.12 to 5.7.11.

Here is the query

INSERT INTO `iavlif_fmp_clientquote` (`jm_cqid`, `fmsq_id`, `fmsg_id`, 
`fm_sctrdate`, `fm_sctrtime`, `fm_sctbaggage_weight`,     
`fm_sctfreight_weight`, `fm_sctpassenger`, `fm_sctinfant`, 
`fm_sctinfant_details`, `fm_sctinfant_dob`, `fmtp_id`, `fmtpi_id`,
`jmcnt_id`, `fm_name`, `fm_company`, `fm_email`, `fm_phone`, `fmts_id`,
`jmts_id`, `fm_pax_nbr`, `fm_hours_nbr`, `fmqt_id`, `fmtr_id`,
`fm_sctnotes`, `fm_locdepart`, `fm_locarrive`, `fm_sctconsignment_weight`,
`fm_sctconsignment_dimensions`, `fm_sctconsignment_desc`, `fm_sctdangerous`,
`fm_scturgent`, `fm_sctspecial_instructions`, `fm_sctquote_type`,
`fm_sctwork_type`, `fm_sctreoccuring`, `fm_sctaccommodation`, `fm_sctcar`,
`fm_recdate`, `fm_recenddate`, `fm_recfrequency`, `fm_rectime`,    
`fm_medical`, `fm_medical_details`, `fm_user_ip`, `fm_dang_details`,
`fm_sctsubstance`, `fm_sctpurchase_number`, `fm_role_id`, `fm_myrole_id`,
`jm_myrole_id`, `fm_sctwork_point`, `fm_locdepartarrive`, `fm_sctnbr`, 
`fm_dateCreated`, `fm_cc`, `fm_gl`, `fm_timeCreated`, `jm_qtid`, `jmtp_id`,
`jmtpi_id`, `jmsg_id`, `jms_id`, `jmsq_id`, `fms_id`, `fmcq_id`) VALUES
(NULL, '1', '1', '0000-00-00', '1', '1', '1', 'sdfasd', 'No',
'sdafdsafdsaf', 'dsfas', 'sdfasd', 'dsafds', '0', 'asdfds', 'sdfasd',
'sdfads', 'sdaf', 'sdaf', 'sdaf', '0', '0', '0', '1sadfasdsda', 'sdfadsf',
'as', 'as', 'as', 'asas', 'asd', 'No', 'No', 'adsfsd', 'eqwrqew', 'qewrqew',
'No', 'No', 'No', '0000-00-00', '0000-00-00', 'ewqr', 'qewrw', 'No', 'eqwr',
'ewqr', 'qewr', '', '', '', '', '', '', '', '0', '0000-00-00', '', '',
'00:00:00.000000', '', '', '', '', '', '', '', NULL)

We started facing this issue just after upgrade of mysql

This question is related to mysql sql date phpmyadmin

The answer is


The error is because of the sql mode which can be strict mode as per latest MYSQL 5.7 documentation.

For more information read this.

Hope it helps.


You have 3 options to make your way:
1. Define a date value like '1970-01-01'
2. Select NULL from the dropdown to keep it blank.
3. Select CURRENT_TIMESTAMP to set current datetime as default value.


After reviewing MySQL 5.7 changes, MySql stopped supporting zero values in date / datetime.

It's incorrect to use zeros in date or in datetime, just put null instead of zeros.


Examples related to mysql

Implement specialization in ER diagram How to post query parameters with Axios? PHP with MySQL 8.0+ error: The server requested authentication method unknown to the client Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver' phpMyAdmin - Error > Incorrect format parameter? Authentication plugin 'caching_sha2_password' is not supported How to resolve Unable to load authentication plugin 'caching_sha2_password' issue Connection Java-MySql : Public Key Retrieval is not allowed How to grant all privileges to root user in MySQL 8.0 MySQL 8.0 - Client does not support authentication protocol requested by server; consider upgrading MySQL client

Examples related to sql

Passing multiple values for same variable in stored procedure SQL permissions for roles Generic XSLT Search and Replace template Access And/Or exclusions Pyspark: Filter dataframe based on multiple conditions Subtracting 1 day from a timestamp date PYODBC--Data source name not found and no default driver specified select rows in sql with latest date for each ID repeated multiple times ALTER TABLE DROP COLUMN failed because one or more objects access this column Create Local SQL Server database

Examples related to date

How do I format {{$timestamp}} as MM/DD/YYYY in Postman? iOS Swift - Get the Current Local Time and Date Timestamp Typescript Date Type? how to convert current date to YYYY-MM-DD format with angular 2 SQL Server date format yyyymmdd Date to milliseconds and back to date in Swift Check if date is a valid one change the date format in laravel view page Moment js get first and last day of current month How can I convert a date into an integer?

Examples related to phpmyadmin

phpMyAdmin on MySQL 8.0 phpmyadmin - count(): Parameter must be an array or an object that implements Countable Error loading MySQLdb Module 'Did you install mysqlclient or MySQL-python?' phpMyAdmin ERROR: mysqli_real_connect(): (HY000/1045): Access denied for user 'pma'@'localhost' (using password: NO) phpMyAdmin access denied for user 'root'@'localhost' (using password: NO) mysqli_real_connect(): (HY000/2002): No such file or directory How to create a foreign key in phpmyadmin #1292 - Incorrect date value: '0000-00-00' MySQL error - #1932 - Table 'phpmyadmin.pma user config' doesn't exist in engine phpMyAdmin Error: The mbstring extension is missing. Please check your PHP configuration