UBBCentral

Help with my mysql connectivity brain fart...

Posted By: bakerzdosen

Help with my mysql connectivity brain fart... - 06/20/11 06:14 PM

Long story short: We're moving to a new physical server. It's running CentOS (as is the current one.)

I copied the httpd.conf and my.cnf files over, the entire htdocs directory, and ran a backup of the db. On the new system, I installed the "old" conf files, restarted the services, changed the root user password in mysql and then added the user/password we're using for ubb to connect to the db. I restored the backup sql file. I did a grant (in fact, I granted all *.* to that user just to test) for that user.

Using the username/password combo I created, I can log in from the command line, use the ubb mysql db, and the selects that I have run (eg select count(*) from ubbt_POSTS) have all returned exactly as expected.

Now, with that said, I'm still getting "Unable to connect to database server, please try again in a few minutes." when I try to use ubb (the rest of the website works fine and I've made an entry for the site in my hosts file). If I point UBB at my dev database (after poking a hole in the firewall) it works fine. So, all signs point to something I somehow screwed up on the new server with mysql (5.0.77 if it matters). However, I'm just not seeing it...

Anyone?

I seem to remember a way to turn on additional error logging from a config file, but I'm not sure that would help here, and I don't remember how anyway.
Posted By: Ruben

Re: Help with my mysql connectivity brain fart... - 06/20/11 06:24 PM

You need to edit the paths/user/pasword in the includes/config.inc.php file.
most of it is the top couple of lines. Then that should get you running enough to open the control panel.
Posted By: bakerzdosen

Re: Help with my mysql connectivity brain fart... - 06/20/11 09:27 PM

Originally Posted by Ruben
You need to edit the paths/user/pasword in the includes/config.inc.php file.
most of it is the top couple of lines. Then that should get you running enough to open the control panel.
That's actually how I was able to connect to the "dev" database as I mentioned. When I moved it back to "localhost" it continued giving me the same error. I didn't change the username/password from the original server (yet). I simply added the user/pass (and the applicable grants) to the new mysqld instance.

That hasn't helped, but thanks. (For the record, I actually have tried the root user/pass combo in that file with the same results.)

And also for the record, running phpinfo() in a file gives basically identical results - at least where it matters. The one potential difference is in the mysql.default_socket setting isn't set (no value) in the new server - but I'm pretty sure that can be attributed to not being able to connect to mysql.

Looking at this, it seems that the issue has got to be with mysql or php. Yet, the my.cnf file is the same one from production (aka the port is correct.) I can connect from the command line (and I've changed them a few times) using both the ubbthreads user as well as root, so I doubt it's the user/pass combo. The instance is running in the same OS as apache/php so I don't think it's somehow denying connections based on it being remote.

bind-address is not set in the my.cnf file.

nsswitch.conf is (correctly) set to "files dns" for hosts.

umask is at 22.

I tar'd the htdocs folder, so permissions are the same (I made sure the userid's lined up for apache and mysql.)

Also, we have several domains pointing at our webserver. In our current production setup, the when you hit the forums, it redirects you to a certain domain (also set up in the config.inc.php file). That is not happening here. I get the error regardless of which domain I attempt to utilize and yet never get redirected. However, the sessions directory is registering new sessions whenever I hit the main ubb page.

I dunno - there has got to be some little tidbit I'm missing here (obviously).
Posted By: Ruben

Re: Help with my mysql connectivity brain fart... - 06/20/11 09:38 PM

Well if you never enabled the mysql error logs in ubb,you will get that generic message but no detail files to view in the folder it would be stored in.

If there are any helpful details.

There is a cheat however to see if it is reporting anything specific.
Edit libs/mysql.inc.php.
search for $showerror=0
change that value to 1.
if there is any additional errors reported it will appear in the browser.

Just note though when done change it back to 0.
because all users will see the details.
Posted By: bakerzdosen

Re: Help with my mysql connectivity brain fart... - 06/20/11 09:38 PM

OK, it actually WAS the my.cnf file. (Weird.) I put the original one back in and suddenly I'm in.

Thanks anyway.

Sheesh.

Oh well, now I get to go through and re-customize my my.cnf file. Probably for the best.
Posted By: Rick

Re: Help with my mysql connectivity brain fart... - 06/21/11 01:22 PM

You may have had, or not had, the skip-networking line in your my.cnf. Depending on your setup on the new server, that would cause the issue you were experiencing, so when re-customizing your .cnf file watch for that line. This looked to be a connectivity issue rather than a username/password issue.
© 2017 UBB.threads PHP Forum Software Community