forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 install => Topic started by: St. Anger on September 23, 2010, 10:06:32 pm

Title: MySQL Database Connection Error
Post by: St. Anger on September 23, 2010, 10:06:32 pm
About a week ago my website was hacked all my files deleted. The CPG database was restored, as were the images in the albums directory. Everything else I don't have, however.

I decided to upload the CPG 1.5 files and perform the upgrade (my previous CPG version was 4.2.6 I think). Anyway, I get this error when attempting to access the upgrade page:

Quote
Coppermine critical error:
Unable to connect to database !

MySQL said: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

However, I've checked the database connection information and everything is correct. What should I do?

My gallery URL is http://www.metcoverart.com/gallery/

Thanks for any help
Title: Re: MySQL Database Connection Error
Post by: phill104 on September 23, 2010, 10:27:30 pm
Speak to your host as it is almost certainly a hosting problem. Googling '/var/run/mysqld/mysqld.sock' brings up loads of answers as to what may have happened.
Title: Re: MySQL Database Connection Error
Post by: St. Anger on September 24, 2010, 08:56:51 am
I asked my host about it and the support tech restarted MySQL, tested logging into phpMyAdmin, and accessing MySQL from the web server. All worked fine. He suggested extra spaces in the config.inc.php file may be causing problems, so I deleted extra spaces and reuploaded the config file. Now I get a different error:

Quote
Coppermine critical error:
The group table does not contain the Anonymous group !
Title: Re: MySQL Database Connection Error
Post by: St. Anger on September 24, 2010, 09:01:47 am
^ That's when accessing the CPG 1.5 upgrade script. If I try to access any other pages I get a "Fatal Error" with a blank message.

By the way, there is no Anonymous user group because my gallery was bridged with my IPB forum, so it uses the forum member groups.
Title: Re: MySQL Database Connection Error
Post by: Αndré on September 27, 2010, 12:06:04 pm
You can manually add that group by performing that query in phpMyAdmin:
Code: [Select]
INSERT INTO CPG_usergroups VALUES (3, 'Anonymous', 0, 0, 1, 0, 0, 0, 0, 1, 1, 3);
Don't forget to adjust the table prefix 'CPG_'.
Title: Re: MySQL Database Connection Error
Post by: St. Anger on September 27, 2010, 05:58:33 pm
Thank you for your help :)

I ran the query and added the group, and I then checked the rows to make sure it was there. But, when I ran update.php I got the same error, and after checking the database the Anonymous user group was no longer there.  I tried adding it again and running update.php again but got the same problem, like it's deleting that group.
Title: Re: MySQL Database Connection Error
Post by: Jeff Bailey on September 27, 2010, 06:12:54 pm
You can't run update.php without being logged in.
which is what I assume your doing since I get the same error when I view it.
Quote
Coppermine critical error:
The group table does not contain the Anonymous group !

Go to your phpMyAdmin and enable debug mode and fix the Fatal Error before trying to get update.php to work.
http://documentation.coppermine-gallery.net/en/errors.htm#errors_debug_mode_manual
Title: Re: MySQL Database Connection Error
Post by: Αndré on September 27, 2010, 06:20:52 pm
Since cpg1.5.x you cannot run update.php without administration privileges. I assume you haven't replaced all files properly.