Solved

MySQL Error 1067: Invalid default value for

Posted on 2009-05-11
2
1,495 Views
Last Modified: 2013-12-12
Hello.

I have created a backup of a database
(mysqldump -h localhost -u root -p database_name > database_dump.sql)

Then I have updated my system from MySQL 4.0 to 5.0.45. I have created a clean OS install (centos 5.3 and mysql 5.0.45)

Since the old database wasn`t Utf-8 I converted it:
ICONV -f ISO-8859-2 -t UTF-8 database_dump.sql > database_dump_utf.sql

Then I `ve tried to import this dump:
(mysql -u root -p)
(create database database_name)
mysql -h localhost -u root -p database_name < database_dump_utf.sql

... but I get this error:
ERROR 1067 (42000) at line 10: Invalid default value for

For all others databases the procedure worked ok,

Thank you
0
Comment
Question by:SimpleJ
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 8

Accepted Solution

by:
Bobaran98 earned 500 total points
ID: 24357644
Sounds like your error is in the definition of that table.  Step through your CREATE TABLE statement and see if you find any fields with default values that don't make sense.  If nothing jumps out at you, I suggest going line by line... in other words, start by eliminating from your CREATE TABLE statement all fields but the key(s), then run the statement and see if it works.  If so, then drop the table, add back in the next field, and run the CREATE statement again.  In this manner, you should be able to identify the field with the default value it doesn't like.  If the problem isn't obvious then, post that line here and we'll take a look at it.

Hope this helps!
0
 
LVL 1

Author Comment

by:SimpleJ
ID: 24362895
I thought it would be "cleaner" solution to this ;)

Will try and report ....

thank you
0

Featured Post

Webinar: Choosing a MySQL HA Solution

Join Percona’s Principal Technical Services Engineer, Marcos Albe as he presents Choosing a MySQL High Availability Solution on Thursday, June 29, 2017 at 10:00 am PDT / 2:00 pm EDT (UTC-7).

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question