forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: treehstn on October 15, 2013, 02:01:10 am

Title: Critical error: unable to connect to UDB database
Post by: treehstn on October 15, 2013, 02:01:10 am
Hi,

I have not worked on my website in a couple of years and need to get it updated and running again.  I can see that my database tables for coppermine are using the prefix cpg14x_ so I'm sure that I had version 1.4 working at some time.  I need to upgrade to 1.5 and continue adding photos.

When I try to view coppermine in a web browser I get this message:

Coppermine critical error:
Unable to connect to UDB database !

MySQL said:


I get the same message when running the version checker.  I've checked the includes/config.inc.php file and believe all of the login information to be correct.  I'm using the following safe mode work around since I'm using hostgator for my hosting service (I commented this out and got the same result):

// Silly safe mode
define('SILLY_SAFE_MODE', 1);

The said site is http://www.glassresearch.net/coppermine/

I've searched the forum and have not found anything that has worked on correcting this issue.  Any help or direction would be much appreciated.
Title: Re: Critical error: unable to connect to UDB database
Post by: treehstn on October 15, 2013, 04:35:49 am
I'm pretty sure that I have the dbserver, dbuser, dbpass, and dbname all correct since I verified it all using myphpadmin.

Could the smf bridge have anything to do with this?  It's been so long since I've worked with my site I can't remember what affects what enough to troubleshoot this.
Title: Re: Critical error: unable to connect to UDB database
Post by: Jeff Bailey on October 15, 2013, 05:38:40 am
Looks like your using v1.4.19. If you can find out what the actual error is you'll probably be able to fix the problem (update password, repair table ... )

Use PHPMyAdmin to change the debug mode.
1.5.x docs: http://documentation.coppermine-gallery.net/en/errors.htm#errors_debug_mode_manual
Title: Re: Critical error: unable to connect to UDB database
Post by: treehstn on October 15, 2013, 09:13:00 am
I set the debug mode as instructed and it didn't put any more information on the page... I'm not finding anywhere in my hostgator files where it's saving any mysql error logs or any other logs that might be helpful...
Title: Re: Critical error: unable to connect to UDB database
Post by: Phill Luckhurst on October 15, 2013, 10:57:51 am
You should contact hostgator to check that all the credentials are correct and that there is no fault on their end

Another option would be to download your db and files to your local machine and using a tool such as WAMP test everything is working obviously not forgetting to change the db details in config.inc.php. If all is working as expected do the upgrade locally while you try and find out what is wrong with your hosting.

If your hostgator account is still requiring safe mode then it could also be they have not upgraded PHP as most recent hostgator accounts I have seen no longer are setup that way. So again, it might be worth having a word with their support.
Title: Re: Critical error: unable to connect to UDB database
Post by: treehstn on October 15, 2013, 06:04:37 pm
I have another option... I have a domain on hostgator that really is empty.  Would I be correct in testing if I loaded clean updated mambo, coppermine and smf installs on that domain then imported my tables?  I'm thinking that would test the programs themselves.  Hostgator would still be in the mix so it would be a limited test.

I'd have to figure out how to import the tables that have all my data in them....
Title: Re: Critical error: unable to connect to UDB database
Post by: Phill Luckhurst on October 15, 2013, 06:35:02 pm
Am I by that post assuming that you have SMF, Mambo and Coppermine all on the same db and if so do they also have connection problems?

As for Mambo I thought that had all but died out and most of those behind it had forked into Joomla.
Title: Re: Critical error: unable to connect to UDB database
Post by: treehstn on October 15, 2013, 06:36:46 pm
Mambo is working fine.  SMF and coppermine are having issues.  But keep in mind it's been several years since I've worked on the site and there was a server change in there too.  I can't be sure I even had smf and coppermine working correctly since migrating to hostgator.  I just can't remember.
Title: Re: Critical error: unable to connect to UDB database
Post by: treehstn on October 15, 2013, 06:37:32 pm
You can see the main site at http://www.glassresearch.net
Title: Re: Critical error: unable to connect to UDB database
Post by: Phill Luckhurst on October 15, 2013, 06:41:16 pm
So both SMF and CPG are having problems which suggests that db connection details are incorrect. Check the configuration.php file in mambo and compare the db settings.

As for using spare space at hostgator you could do that but much better to work locally as everything will be so much faster. Take a look at wampserver.com/en/ . With that you can install a completer webserver on your desktop and with just a few clicks set it up with the same php and MySQL versions and setting as your live hosting. Then import everything locally for testing.
Title: Re: Critical error: unable to connect to UDB database
Post by: treehstn on October 15, 2013, 06:58:05 pm
Will do... I'll check those settings
Title: Re: Critical error: unable to connect to UDB database
Post by: treehstn on October 15, 2013, 07:09:03 pm
Oh good grief... I just figured out that hostgator changed my server path.  Instead of it being /home/.....   it is /home1/....

Now I have to figure out where in all of mambo, smf and coppermine I need to change that path!  Check out the error message in smf now:

http://www.glassresearch.net/index.php?option=com_smf&Itemid=53

Title: Re: Critical error: unable to connect to UDB database
Post by: treehstn on October 16, 2013, 03:03:00 am
I was only able to find a couple of instances with the wrong server path and updating them made no difference with the issue.... Any other ideas for me to try or research?
Title: Re: Critical error: unable to connect to UDB database
Post by: Phill Luckhurst on October 16, 2013, 10:57:25 am
The path shouldn't cause the unable to connect to DB error you are getting.
Title: Re: Critical error: unable to connect to UDB database
Post by: Niecher on October 16, 2013, 01:10:05 pm
Hello treehstn,

I suggest, create a new file config.inc.php and upload it via ftp overwriting the previous one.

Regards.
Title: Re: Critical error: unable to connect to UDB database
Post by: treehstn on October 16, 2013, 05:06:33 pm
Recreating the config.inc.php file had no effect.
Title: Re: Critical error: unable to connect to UDB database
Post by: Phill Luckhurst on October 16, 2013, 07:21:13 pm
You will need to speak to your host as there is not a lot else we can do. But please try your setup locally as I have suggested above and if it works there then you have more ammo to go to your host with.
Title: Re: Critical error: unable to connect to UDB database
Post by: treehstn on October 17, 2013, 03:11:21 am
Phill... I'm working today on getting all the files and db downloaded and then will run everything local to test as you suggest... will post back with my findings.  Thank you!
Title: Re: Critical error: unable to connect to UDB database
Post by: Niecher on October 17, 2013, 01:32:03 pm
Hello treehstn,

There seems to be a strange behavior in your config.inc.php file. Here (http://www.glassresearch.net/coppermine/include/config.inc.php).

Regards.
Title: Re: Critical error: unable to connect to UDB database
Post by: treehstn on October 17, 2013, 06:36:02 pm
I overwrote the config.inc.php file with a brand new one from the install files.  It didn't make any impact on the connection issue so I put it back to what it was.
Title: Re: Critical error: unable to connect to UDB database
Post by: treehstn on October 20, 2013, 07:50:20 pm
A new piece of troubleshooting data:

I was working with a clean domain on my hosting account and was using it just for testing whether or not there are configuration issues with my hostgator account.  When I tried to install 1.4 on that account it could not find my database.  It was the same issue I'm having on the domain above that I'm trying to fix.  I deleted all the 1.4 files and tried 1.5.  It installed the first time with zero issues!  Using the same database and login information that I had tried before!  It seems that there is some issue with my hostgator account and 1.4.  I wouldn't have any idea how to ask them the correct questions to get it fixed and I really don't want to take the time with them.  I'd rather fix this on my own and get back to working on my site. So...

I found this thread on the forum:  http://forum.coppermine-gallery.net/index.php/topic,74585.msg359080.html#msg359080

I'm in a similar situation as the poster on that thread.  On my main domain I can't access coppermine at all so I can't do a normal upgrade from 1.4 to 1.5.  I'd like to try what is suggested, loading the 1.5 files and then running update.php.  My question is...

I'm assuming that the 1.5 files should be in a separate directory from the 1.4 files and then I run update.php from the 1.5 directory?

Is my logic correct that this might be the best way to go?
Title: Re: Critical error: unable to connect to UDB database
Post by: Phill Luckhurst on October 20, 2013, 08:11:51 pm
Have you downloaded the database and files to your local machine as suggested earlier for testing there to make sure everything is in place and working? Check the link for WAMP I supplied and you will be able to do the whole test in minutes. If it does prove to be a hosting problem and you know it works with 1.5 then it is simple for you to upgrade locally then restore to your live hosting.

If you don't want to do that then just say so as this is the third time I have mentioned it in this thread. I am aware some versions of hostgator have problems which is why I am asking you, again.
Title: Re: Critical error: unable to connect to UDB database
Post by: treehstn on October 20, 2013, 08:23:22 pm
Phill... I tried that but there were lots of error messages with WAMP that I just don't know how to fix.  Here are the messages:

A newer version of phpMyAdmin is available and you should consider upgrading. The newest version is 4.0.8, released on 2013-10-06.
The phpMyAdmin configuration storage is not completely configured, some extended features have been deactivated. To find out why click here.
Your configuration file contains settings (root with no password) that correspond to the default MySQL privileged account. Your MySQL server is running with this default, is open to intrusion, and you really should fix this security hole by setting a password for user 'root'.


It was pretty obvious when I was trying to get that to work that using a webserver (even a local one) is just over my head. Sorry that I didn't give that information sooner!

Title: Re: Critical error: unable to connect to UDB database
Post by: Phill Luckhurst on October 20, 2013, 09:39:58 pm
Honesty, those errors are little to worry about. WAMP is a simple install and it is done affair. Sorry but there is not too much more we can do to help. You will need to speak to your host or find someone who can access your hosting and help.
Title: Re: Critical error: unable to connect to UDB database
Post by: treehstn on October 20, 2013, 09:54:06 pm
I tried before to just import my database into the WAMP server and it won't work.  This is what the interface says about file size:

Browse your computer:(Max: 2,048KiB)


My database is 174MB so when I try to import it says it's too large.  It says:  You probably tried to upload too large file. Please refer to documentation for ways to workaround this limit.

The documentation link says:

1.16 I cannot upload big dump files (memory, HTTP or timeout problems).

Starting with version 2.7.0, the import engine has been re–written and these problems should not occur. If possible, upgrade your phpMyAdmin to the latest version to take advantage of the new import features.

The first things to check (or ask your host provider to check) are the values of upload_max_filesize, memory_limit and post_max_size in the php.ini configuration file. All of these three settings limit the maximum size of data that can be submitted and handled by PHP. One user also said that post_max_size and memory_limit need to be larger than upload_max_filesize.

There exist several workarounds if your upload is too big or your hosting provider is unwilling to change the settings:

    Look at the $cfg['UploadDir'] feature. This allows one to upload a file to the server via scp, ftp, or your favorite file transfer method. PhpMyAdmin is then able to import the files from the temporary directory. More information is available in the Configuration section of this document.
    Using a utility (such as BigDump) to split the files before uploading. We cannot support this or any third party applications, but are aware of users having success with it.
    If you have shell (command line) access, use MySQL to import the files directly. You can do this by issuing the "source" command from within MySQL: source filename.sql.


It was at this point that I was uncomfortable trying to figure out sql commands to try to get this to work.  I'm not trying to be difficult... I just don't know enough about these technologies (sql and webservers) to understand what changes need to be made to get this to work. 

It looked to me like the option in the thread I posted was viable but I don't want to mess up my install any more than it already is.  And when you are saying I should talk to my host I don't even know what to ask them!  If I just tell them that this program that I loaded on my hosting space doesn't work they are just going to tell me to contact the program's support people.  I'd have to know what specifically to ask them about.
Title: Re: Critical error: unable to connect to UDB database
Post by: Phill Luckhurst on October 20, 2013, 10:44:17 pm
It seems you have a very old version of WAMP because the latest version comes with phpmyadmin 3.4.5
Title: Re: Critical error: unable to connect to UDB database
Post by: treehstn on October 20, 2013, 10:57:23 pm
I just downloaded it... had never heard of the program before.  I'll go find a newer version and try that.  Thanks!
Title: Re: Critical error: unable to connect to UDB database
Post by: treehstn on October 20, 2013, 11:31:53 pm
I just went to http://www.wampserver.com/en/ and then to their download link.  I installed from the button that says "WAMP Server (64 bits & PHP 5.4) 2.4.

I installed it and logged into the phpmyadmin.  When I try to import the database I get the same message as before.  The file is too big.
Title: Re: Critical error: unable to connect to UDB database
Post by: treehstn on October 26, 2013, 06:32:26 am
After struggling with trying to figure how to get my gallery updated from 1.4 to 1.5 I made the decision to move the domain off of hostgator since I've been having other issues with the host anyway.

Going back over the notes and suggestions here I've figured out this much:

1.  I still have not been able to get the gallery itself to load in a browser. 
2.  I did figure out how to export/import large db files in phpmyadmin.
3.  The gallery would not load in the WAMP server.  I'm attaching a photo of what the browser looks like when trying to load the gallery. (I'm not convinced this is a good troubleshooting step since it's introducing a whole other level of complexity working with the db in a different environment.)

At this point I moved my domain to a different hosting company.

1.  I loaded the coppermine directory and the database exactly as it was on hostgator.  I was still not able to load the gallery.  I had the same error messages as before, as if it couldn't connect to the database even though I knew all the login information was correct.
2.  I tried uploading the 1.5 files and ran the update.php script.  It ran!!  But after it ran I still cannot view the gallery.  Here is the error message I'm getting now:

Notice: Undefined offset: 8192 in /mounted-storage/home81b/sub001/sc44840-OTZJ/glassresearch.net/coppermine/include/debugger.inc.php on line 112

It seems like I'm back to square one?  I still can't access the gallery.  If it's a problem with the hosting I still haven't been given any advice on what to ask the hosting company about.  I don't know what the hosting might have to do with the issue.

I can't find any information on the forum about what someone can do if their files or database are corrupted.  Not that I know for sure corruption is the issue.  Isn't there instructions somewhere about making a clean install of the most current version of coppermine and then importing the tables with user data into them?  If it is corruption how is that fixed?

Here is a link to the gallery:  http://www.glassresearch.net/coppermine/

Thank you!
Title: Re: Critical error: unable to connect to UDB database
Post by: treehstn on October 26, 2013, 06:37:40 am
I also was able to get SMF to load:   http://www.glassresearch.net/smf/