Hello All,
so we are slowly but steadily migrating from MariaDB to CloudSql.
Now we have this issue when we import a csv file that contains a list of persons, including data of birth.
When that cell is empty that's probably not allowed in CloudSql and it then auto-generates 0000-00-00 and
we have to run a query to get it to value NULL
Is there a way to have this automaticaly generate NULL upon import?
Many thanks for any advise.
Greetings, j.
Solved! Go to Solution.
Hi @jameslast,
This is a common issue when moving to Cloud SQL. By default, MySQL (and MariaDB) tend to auto-fill empty date fields with 0000-00-00
, which isn’t allowed in Cloud SQL for strict SQL modes.
You could try to preprocess your CSV before importing—make sure empty date fields are explicitly set to \N
, which MySQL recognizes as NULL
. You may also check this documentation on CSV file format requirements for more details.
Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.
Hi @jameslast,
This is a common issue when moving to Cloud SQL. By default, MySQL (and MariaDB) tend to auto-fill empty date fields with 0000-00-00
, which isn’t allowed in Cloud SQL for strict SQL modes.
You could try to preprocess your CSV before importing—make sure empty date fields are explicitly set to \N
, which MySQL recognizes as NULL
. You may also check this documentation on CSV file format requirements for more details.
Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.
Hello,
thanks for your reply. This explains/solves the issue for us.
Greetings, j.