MySQL Error: Could not connect...using PHP 5.0.5

A couple weeks ago I changed hosts. Before I changed hosts I upgraded to the new version of ZenPhoto...and everything worked perfect.

After changing hosts, I now get the following error: "MySQL Error: Could not connect to the database server." at the top of my page...however I'm completely able to connect to the database and all my albums, photos are viewable and working fine. The problem is that I can't get this Error message off of the page. My new host is running PHP 5.0.5...my last host was running 4.

Any suggestions to patch this up? Here is the page that is causing the error: http://www.mcclure411.com/photogallery_zp/ The error is a little hard to see, but it's at the very top of the page. Thanks for helping.

Comments

  • trisweb Administrator
    How weird! It sure is working alright.

    A quick hack is to find where that error message is given (in functions-db.php) and make it into a blank string, or comment out the line.
  • Cool. Commenting out that line works fine. However I would love to know what is causing that to happen...when ever you get a free second ;)

    Thanks.
  • Okay, now I'm getting this error when I log in to the admin area (so i can edit or add albums):
    Warning: mysql_query() [function.mysql-query]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) in /home/accountname/public_html/photogallery_zp/zen/functions-db.php on line 31

    Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/accountname/public_html/photogallery_zp/zen/functions-db.php on line 31
    MySQL Query ( SELECT * FROM zp_albums ) Failed. Error: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)

    How can i solve this issue?
  • trisweb Administrator
    Does it continue to work after that?

    Either way, definitely contact your host. Seems to be a problem with the MySQL configuration.
  • No...it doesn't work after that. First I login...and immediately get this error, with nothing else visible. How is this a host problem if the rest of ZenPhoto is operating?
  • trisweb Administrator
    Well, the first clue is that the problem is unique to this host and server configuration. It's a very weird problem, I'll give you that.

    Seriously, have you contacted your host and asked them? They're standard queries from PHP. This is not likely a problem with zenphoto.
  • I have sent opened a support ticket with them and I'll see what they say. I'm wondering if this has anything to do with me moving all my file over to a new host...rather than a complete reinstall of zenphoto on the new server?

    I exported my DB from my old host, imported in the new DB and moved my files over...sounds good, but not sure if that is causing any issues? Thanks for the help, I'll post some answers when i hear back from my host.
  • trisweb Administrator
    Exporting the databases shouldn't be that big a problem... unless there was something you missed about the configuration. I don't know. See what they say.
  • they say to use "remotemysqlhost" as the DB connection...which I am. so that really wasn't any help. is it possible that i didn't fully export the DB, maybe I missed a field, or header or something?

    ANything else I should be looking at? My alternative (to fix this problem...hopefully) is to wipe ZenPhoto out of the DB, delete all files, reinstall and start fresh...but of course that would suck and I'd rather not go that route.
  • my server admin has asked to see my config file...so they will check that out pretty soon. I've also given them a link to the part thats working on the website (where the albums display and stuff). hopefully they come up with something.
  • The server admin told me to delete the user name and password for my database connection. They found it was causing problems connecting to the DB. ANyway, I deleted it, recreated it (wikth the exact same name/pass) and it's all good.

    Thanks for taking the time to help me out. ZenPhoto is amazing!
  • trisweb Administrator
    Great, glad you got that solved. :)
  • Dear trisweb/zenphoto,
    Like the script, very cool design!!The best I,ve seen so far.
    However, I'm having the same problem as member mcclure 411,
    moved to hosting with Php 5 and got the same errors
    (no connection with database).
    The Mysql is working fine(I checked).
    Can't get it to work since the switch.
    Any ideas?
    Thanks
    Hans
Sign In or Register to comment.