Solved

MySQL Error 1067: Invalid default value for

Posted on 2009-05-11
2
1,444 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
Comment Utility
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
Comment Utility
I thought it would be "cleaner" solution to this ;)

Will try and report ....

thank you
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
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.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
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 …

763 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

13 Experts available now in Live!

Get 1:1 Help Now