Solved

MySQL Error 1067: Invalid default value for

Posted on 2009-05-11
2
1,457 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
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

As a database administrator, you may need to audit your table(s) to determine whether the data types are optimal for your real-world data needs.  This Article is intended to be a resource for such a task. Preface The other day, I was involved …
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

813 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now