The post_date default value is 0000-00-00 00:00:00. If you check the sql_mode variable like this:
show variables like 'sql_mode';
… it will show you the sql_mode variable, that will be sth like this: ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
You have to set up again sql_mode variable without
NO_ZERO_IN_DATE,NO_ZERO_DATE
So in the previous example you should set the sql_mode like this:
SET sql_mode="ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION";
Then check the sql_mode variable again to be sure it has changed correctly:
show variables like 'sql_mode';
Then the restriction is gone ;D
Found the solution here: https://stackoverflow.com/a/37696251/504910
Related Posts:
- Find locations of all featured images of draft posts via SQL
- SQL query to change custom field in WordPress database
- An SQL query to find orphaned image attachments and their meta
- SQL command to export post_content from wp_posts using phpMyAdmin
- MySQL Error: : ‘Access denied for user ‘root’@’localhost’
- MySQL Error: : ‘Access denied for user ‘root’@’localhost’
- What’s the difference between INNER JOIN, LEFT JOIN, RIGHT JOIN and FULL JOIN? [duplicate]
- Cannot delete or update a parent row: a foreign key constraint fails
- Cannot delete or update a parent row: a foreign key constraint fails
- Rename a column in MySQL
- Cannot delete or update a parent row: a foreign key constraint fails
- How do I restore a dump file from mysqldump?
- How do I import an SQL file using the command line in MySQL?
- #1273 – Unknown collation: ‘utf8mb4_unicode_520_ci’
- What is the definition of cardinality in SQL
- When to use SELECT … FOR UPDATE?
- SQL Query Where Field DOES NOT Contain $x
- Column ‘user_id’ in field list is ambiguous
- How to join two tables by multiple columns in SQL?
- mysql Foreign key constraint is incorrectly formed error
- Selecting data from two different tables without using joins
- 1052: Column ‘id’ in field list is ambiguous
- 1052: Column ‘id’ in field list is ambiguous
- MySQL: Invalid use of group function
- difference between primary key and unique key
- Getting “Lock wait timeout exceeded; try restarting transaction” even though I’m not using a transaction
- Simple Random Samples from a Sql database
- #1045 – Access denied for user ‘root’@’localhost’ (using password: YES)
- What does SQL clause “GROUP BY 1” mean?
- SQL ZOO List each continent and the name of the country that comes first alphabetically
- MySQL Error #1133 – Can’t find any matching row in the user table
- How can I prevent SQL injection in PHP?
- Fatal error: Please read “Security” section of the manual to find out how to run mysqld as root
- Generating a random & unique 8 character string using MySQL
- SQL select only rows with max value on a column
- Unknown Column In Where Clause
- Convert partially non-numeric text into number in MySQL query
- phpmyadmin #1045 Cannot log in to the MySQL server. after installing mysql command line client
- Repair all tables in one go
- How can I search (case-insensitive) in a column using LIKE wildcard?
- How to create a foreign key in phpmyadmin
- MySQL: Can’t create table (errno: 150)
- #1062 – Duplicate entry for key ‘PRIMARY’
- How to do a batch insert in MySQL
- ERROR 1115 (42000): Unknown character set: ‘utf8mb4’
- SQL – IF EXISTS UPDATE ELSE INSERT INTO
- Remove Primary Key in MySQL
- Is merge statement available in MySQL
- Error: Duplicate entry ‘0’ for key ‘PRIMARY’
- MySQL said: Documentation #1045 – Access denied for user ‘root’@’localhost’ (using password: NO)
- How to get the count of each distinct value in a column?
- How do you properly prepare a %LIKE% SQL statement?
- What SQL Query to do a simple find and replace
- Optimize WordPress Query that take 5 seconds to execute
- Scanning Database for malicious Data
- wpdb->prepare function remove single quote for %s in SQL statment
- What specific database privileges does WordPress need?
- Extending the database
- Would manually deleting the dumping data fix a “#1062 – Duplicate entry ‘1’ for key ‘PRIMARY'” phpMyAdmin error?
- How to copy post titles to post slug in phpmyadmin
- How to do a MySQL dump from production site without using a search and replace script for local development?
- How to Create a Admin User for A WordPress Site via MySQL (PHPMyAdmin)?
- SQL error #1062 – Duplicate entry ‘1’ for key ‘PRIMARY’ [closed]
- Can’t find my wordpress DB in phpmyadmin
- SQL Database, repeated tables?
- Backing up and restoring multiple sites efficiently
- $wpdb to insert html form information
- Code to remove authors with no posts connected to them
- SQL command to convert all tags in lowercase?
- SQL Query in WordPress – Getting Impossible WHERE error
- Setting up WordPress Locally on WAMP for a new site (with one already)
- How to get INSERT errors from $wpdb?
- Getting Error Trying to Create Table
- Export Yoast Keywords from MySQL/phpMyAdmin
- How can I write a formal sql query to get data from a custom table
- List users with the most posts in the last 30 days
- Export SQL query based on custom field?
- Data is not constatntly loading from custom wordpress table
- Mysql Server keeps crashing
- Lock wait timeout exceeded; try restarting transaction
- I wanted to Know that how can I give ingore to 0000-00-00 in my config file
- How to bulk delete a certain part of all wordpress posts
- When I add metadata, metavalue length is added in to the value in some cases
- WordPress fails to install with “Can’t Select Database” Error (WAMPServer)
- Update WooCommerce stock status with SQL query if stock value is greater than 0
- How to show result of sql query in a page?
- update_option returns false in AJAX, how to debug?
- Improving performance of SQL sub-queries in WordPress
- Display MySQL as part of a Page
- $wpdb post type and term query only works when there are no dashes or spaces in the term slug and title
- get_results() query not working only when entering strings
- SQL error on restoring database
- optimise SQL wordpress call
- Query sql for truncate post_content in wp_posts table
- Woocommerce: Grab total revenue of a product over all orders
- Delete posts with word count less than x number of words
- SQL – Pull products of particular category from a remote WordPress woocommerce db
- cannot log in to the mysql server (wamp and wordpress)
- Is there an equivalent of MySQL’s SHOW CREATE TABLE in Postgres?
- Possible SQL injection. How to locate and fix?