forum.coppermine-gallery.net

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Permissions & Access Rights => Topic started by: LayZ.Tiger on August 16, 2004, 03:59:00 pm

Title: [Solved]: Database query error after server migration
Post by: LayZ.Tiger on August 16, 2004, 03:59:00 pm
After my hosting provider migrated me to another server, my Coppermine gallery didn't work anymore. The only thing I get now when surfing to the gallery is:

Fatal error :
There was an error while processing a database query


I figured this was caused by the migration of the MySQL database, as the database host and userid that Coppermine used to access the database were altered. I changed this and sent the new config file to the server using FTP, but to no avail.

I searched this forum and found some tips where people advised to go to the control panel and turn on the logging. Since I can imagine that the error message by itself is not enough to help me out, I would like to turn the logging on manually. Is there any way to do this, or does somebody have any other hints or tips perhaps?
Title: Re: Database query error after server migration
Post by: Nibbler on August 16, 2004, 04:27:08 pm
You need to enable debug mode to see the real error message. If you cannot login you will need to edit the value for debug_mode in coppermine's config table with a mysql admin program such as phpMyAdmin from 0 to 1
Title: Re: Database query error after server migration
Post by: LayZ.Tiger on August 16, 2004, 11:01:53 pm
Using PHPMyAdmin, I enabled the logging. The error message gave:

While executing query "SELECT extension, mime, content FROM cpg11d_filetypes;" on 0

mySQL error: Table '1583coppe.cpg11d_filetypes' doesn't exist


Which is about right, since the filetypes table indeed doesn't exist. But I'm flabbergasted as to how the table could disappear and even more clueless how to solve this.
Anyone?
Title: Re: Database query error after server migration
Post by: Joachim Müller on August 17, 2004, 08:06:09 am
you can manually create it, using phpMyAdmin (make sure to change the prefixes to match your coppermine prefix).
Step one: create the table:
Code: [Select]
CREATE TABLE IF NOT EXISTS CPG_filetypes (
  extension char(7) NOT NULL default '',
  mime char(30) default NULL,
  content char(15) default NULL,
  PRIMARY KEY (extension)
) TYPE=MyISAM COMMENT='Used to store the file extensions';

Step two: populate it with entries:
Code: [Select]
INSERT INTO CPG_filetypes VALUES ('jpg', 'image/jpg', 'image');
INSERT INTO CPG_filetypes VALUES ('jpeg', 'image/jpeg', 'image');
INSERT INTO CPG_filetypes VALUES ('jpe', 'image/jpe', 'image');
INSERT INTO CPG_filetypes VALUES ('gif', 'image/gif', 'image');
INSERT INTO CPG_filetypes VALUES ('png', 'image/png', 'image');
INSERT INTO CPG_filetypes VALUES ('psd', 'image/psd', 'image');
INSERT INTO CPG_filetypes VALUES ('bmp', 'image/bmp', 'image');
INSERT INTO CPG_filetypes VALUES ('jpc', 'image/jpc', 'image');
INSERT INTO CPG_filetypes VALUES ('jp2', 'image/jp2', 'image');
INSERT INTO CPG_filetypes VALUES ('jpx', 'image/jpx', 'image');
INSERT INTO CPG_filetypes VALUES ('jb2', 'image/jb2', 'image');
INSERT INTO CPG_filetypes VALUES ('swc', 'image/swc', 'image');
INSERT INTO CPG_filetypes VALUES ('iff', 'image/iff', 'image');
UPDATE CPG_config SET value='ALL' WHERE name='allowed_img_types';

INSERT INTO CPG_filetypes VALUES ('asf', 'video/x-ms-asf', 'movie');
INSERT INTO CPG_filetypes VALUES ('asx', 'video/x-ms-asx', 'movie');
INSERT INTO CPG_filetypes VALUES ('mpg', 'video/mpeg', 'movie');
INSERT INTO CPG_filetypes VALUES ('mpeg', 'video/mpeg', 'movie');
INSERT INTO CPG_filetypes VALUES ('wmv', 'video/x-ms-wmv', 'movie');
INSERT INTO CPG_filetypes VALUES ('swf', 'application/x-shockwave-flash', 'movie');
INSERT INTO CPG_filetypes VALUES ('avi', 'video/avi', 'movie');
INSERT INTO CPG_filetypes VALUES ('mov', 'video/quicktime', 'movie');
INSERT INTO CPG_config VALUES ('allowed_mov_types', 'ALL');

INSERT INTO CPG_filetypes VALUES ('mp3', 'audio/mpeg3', 'audio');
INSERT INTO CPG_filetypes VALUES ('midi', 'audio/midi', 'audio');
INSERT INTO CPG_filetypes VALUES ('mid', 'audio/midi', 'audio');
INSERT INTO CPG_filetypes VALUES ('wma', 'audio/x-ms-wma', 'audio');
INSERT INTO CPG_filetypes VALUES ('wav', 'audio/wav', 'audio');
INSERT INTO CPG_filetypes VALUES ('ogg', 'audio/ogg', 'audio');
INSERT INTO CPG_config VALUES ('allowed_snd_types', 'ALL');

INSERT INTO CPG_filetypes VALUES ('ram', 'audio/x-pn-realaudio', 'document');
INSERT INTO CPG_filetypes VALUES ('ra', 'audio/x-realaudio', 'document');
INSERT INTO CPG_filetypes VALUES ('rm', 'audio/x-realmedia', 'document');
INSERT INTO CPG_filetypes VALUES ('tiff', 'image/tiff', 'document');
INSERT INTO CPG_filetypes VALUES ('tif', 'image/tif', 'document');
INSERT INTO CPG_filetypes VALUES ('doc', 'application/msword', 'document');
INSERT INTO CPG_filetypes VALUES ('txt', 'text/plain', 'document');
INSERT INTO CPG_filetypes VALUES ('rtf', 'text/richtext', 'document');
INSERT INTO CPG_filetypes VALUES ('pdf', 'application/pdf', 'document');
INSERT INTO CPG_filetypes VALUES ('xls', 'application/excel', 'document');
INSERT INTO CPG_filetypes VALUES ('pps', 'application/powerpoint', 'document');
INSERT INTO CPG_filetypes VALUES ('ppt', 'application/powerpoint', 'document');
INSERT INTO CPG_filetypes VALUES ('zip', 'application/zip', 'document');
INSERT INTO CPG_filetypes VALUES ('rar', 'application/rar', 'document');
INSERT INTO CPG_filetypes VALUES ('gz', 'application/gz', 'document');
INSERT INTO CPG_filetypes VALUES ('mdb', 'application/msaccess', 'document');
INSERT INTO CPG_config VALUES ('allowed_doc_types', 'ALL');

HTH

GauGau
Title: Re: Database query error after server migration
Post by: LayZ.Tiger on August 17, 2004, 06:47:32 pm
Thanks GauGau. I have succesfully executed the queries. When I go to my Coppermine Gallery, I get a new error:

While executing query "SELECT MAX(group_quota) as disk_max, MIN(group_quota) as disk_min, MAX(can_rate_pictures) as can_rate_pictures, MAX(can_send_ecards) as can_send_ecards, MAX(upload_form_config) as ufc_max, MIN(upload_form_config) as ufc_min, MAX(custom_user_upload) as custom_user_upload, MAX(num_file_upload) as num_file_upload, MAX(num_URI_upload) as num_URI_upload, MAX(can_post_comments) as can_post_comments, MAX(can_upload_pictures) as can_upload_pictures, MAX(can_create_albums) as can_create_albums, MAX(has_admin_access) as has_admin_access, MIN(pub_upl_need_approval) as pub_upl_need_approval, MIN( priv_upl_need_approval) as  priv_upl_need_approval FROM cpg11d_usergroups WHERE group_id in (3)" on 0

mySQL error: Unknown column 'upload_form_config' in 'field list'



Any more ideas?  :-[
Title: Re: Database query error after server migration
Post by: Nibbler on August 17, 2004, 06:57:48 pm
run update.php
Title: Re: Database query error after server migration
Post by: Joachim Müller on August 18, 2004, 08:23:53 am
...if this doesn't help, make sure your mySQL db user has permission to perform the ALTER command. If you're not sure, contact your webhost.

GauGau
Title: Re: Database query error after server migration
Post by: LayZ.Tiger on August 18, 2004, 04:23:01 pm
Running update.php did the trick. It seemed that I had mixed mixed two galleries.  :-[

I have straightened things out now. Guys, I greatly appreciate the effort you guys put in to help me out. Thanks a lot!  :)