Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: MySQL Database Connection Error  (Read 7196 times)

0 Members and 1 Guest are viewing this topic.

St. Anger

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 107
MySQL Database Connection Error
« 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
Logged

phill104

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4885
    • Windsurf.me
Re: MySQL Database Connection Error
« Reply #1 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.
Logged
It is a mistake to think you can solve any major problems just with potatoes.

St. Anger

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 107
Re: MySQL Database Connection Error
« Reply #2 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 !
Logged

St. Anger

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 107
Re: MySQL Database Connection Error
« Reply #3 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.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: MySQL Database Connection Error
« Reply #4 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_'.
Logged

St. Anger

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 107
Re: MySQL Database Connection Error
« Reply #5 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.
Logged

Jeff Bailey

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1322
  • Fishing relaxes me.
    • Bailey Family Co.
Re: MySQL Database Connection Error
« Reply #6 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
Logged
Thinking is the hardest work there is, which is probably the reason why so few engage in it. - Henry Ford

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: MySQL Database Connection Error
« Reply #7 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.
Logged
Pages: [1]   Go Up
 

Page created in 0.022 seconds with 19 queries.