?
Solved

MySQL Error 1067: Invalid default value for

Posted on 2009-05-11
2
Medium Priority
?
1,505 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 2000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
In this article, we’ll look at how to deploy ProxySQL.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

770 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