I have just migrated the entire database from one server (MySQL 4.1.9) to another (MySQL 5.0.22) and it looks as if all primary keys (?) are missing from insert statements.
When I add a comment the message is "mySQL error: Field 'msg_id' doesn't have a default value"
When e.g. rate a picture the message is "mySQL error: Field 'sid' doesn't have a default value"
New albums: "mySQL error: Field 'aid' doesn't have a default value"
etc
I upgraded from 1.4.6 to 1.4.8 but that didn't help.
Any help on this is much appreciated.
Jesper
The primary keys are there - mySQL5 complains about missing default values (because it is more strict than mySQL4). Add the default values if you know your way around (using phpMyAdmin). Take a look at sql/schema.sql to get an idea what the default values should look like.
Thanks, that did the trick. I went to MySQL Admin, Catalog, chose the database and checked the "autoincrement" option for the integer primary keys in each table.
That's not the fix for the error message you posted above. However, if it works for you, then fine.
@all others who have similar issues: the autoincrement and the default value issue are entirely different animals.
I understand that, but looking at the schema.sql file as you suggested, I noticed that the msg_id field of the comments table had the autoincrement proptery, and no default value. And as it was msg_id that it had complaints about, I set the auto increment property.
Although the error msg was about default values, having a default value on a primary key didn't make much sense to me (I admit that I'm not a db expert). Anyway, it appears to be working now, if not, I'm sure I'll call for help again :) Thanks again.