Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Cannot insert new records  (Read 3431 times)

0 Members and 1 Guest are viewing this topic.

jesperd

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Cannot insert new records
« on: July 21, 2006, 01:40:34 am »

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
« Last Edit: July 22, 2006, 04:30:48 pm by GauGau »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Cannot insert new records
« Reply #1 on: July 21, 2006, 07:04:44 am »

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.
Logged

jesperd

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: Cannot insert new records
« Reply #2 on: July 21, 2006, 09:40:11 am »

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.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Cannot insert new records
« Reply #3 on: July 22, 2006, 04:30:36 pm »

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.
Logged

jesperd

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: Cannot insert new records
« Reply #4 on: July 24, 2006, 12:07:28 am »

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.
Logged
Pages: [1]   Go Up
 

Page created in 0.014 seconds with 15 queries.