Unable to connect to database


I have fixed all installation issues, but after i enter my correct mysql login details and server, i get a "Unable to connect to database." error message.

I know the details are correct because i downloaded MySql WorkBench and i was able to connect through it with the same details.

I have a few questions:
Is it possible that i can connect through WorkBench but no through php?
Is there a place where i can find a more detailed error message?

Also if i surf to concrete5 without "index.php" i get all kinds of installation errors, but if i add "index.php" then my system passes every installation test.

I am using IIS 7.5.

Any other suggestions?

View Replies: View Best Answer
lavalvel replied on at Permalink Reply
I know !!! I have the same exact problem. All of my information is correct. such a complete bummer. Wanted to see what the was all about.

robi replied on at Permalink Best Answer Reply
Hi, i was able to solve my problem.

First i created a dbtest.php file and placed it next to the index.php file so i can get more information of what is going wrong.

This is the code i used in the file:
mysql_connect("localhost", "root", "<my pass here>") or die(mysql_error());
echo "Connected to MySQL<br />";
mysql_select_db("<my db name here>") or die(mysql_error());
echo "Connected to Database";

So then i saw that i couldn't connect to mysql. I tried reconfiguring mysql but i ended up breaking it because of Plesk - If you have plesk installed you should not try to reconfigure your mysql db!

Now i had 2 options - call my hosting provider and ask for a format of my server, or install a parallel version of mysql myself.

So i ended up doing the second option and just installed another version of mysql on my server.

Now i just had to create a new empty schema for plesk, and then the installation worked! :)

I would suggest you first try creating the dbtest.php file and tell us what error you are getting.
MattWaters replied on at Permalink Reply
Has your host provided any specific socket / port settings?
lavalvel replied on at Permalink Reply
Not that I know of. It was a dreamhost 1 click install thing. I also used filezila to set the correct folder write attributes
MattWaters replied on at Permalink Reply
Hmm, that's odd-- I'd recommend you get in touch with Dreamhost technical support. Their installers should be configured to connect to your MySQL database without issue. (I've used concrete5 auto-installs on Dreamhost without issue in the past...)

I'm also pretty sure they just do Linux / Apache boxes-- haven't heard anything about IIS, which is what the original poster is using. I mention this because an IIS install often presents different problems than a vanilla LAMP setup.
lavalvel replied on at Permalink Reply
ok, ill give that a shot. yeah it seems like this should just be plug and play dangit!!!
MattWaters replied on at Permalink Reply
They're pretty responsive on tech support, from what I've seen, so you should be in good hands.