CodeIgniter Forums
MySQL Connection Issues - Dreamhost - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: MySQL Connection Issues - Dreamhost (/showthread.php?tid=8560)



MySQL Connection Issues - Dreamhost - El Forum - 05-22-2008

[eluser]Crazy88s[/eluser]
I'm trying to get my site working correctly on my host Dreamhost but I seem to be having an issue with MySQL. I get the following error when trying to view my site:

Unable to connect to your database server using the provided settings.

I have verified that my database settings are correct and I can access the MySQL database using Phpmyadmin just fine.

My config is as follows:

Code:
$active_group = "default";
$active_record = TRUE;

$db['default']['hostname'] = "sql.mydomain.com";
$db['default']['username'] = "user";
$db['default']['password'] = "password";
$db['default']['database'] = "databasename";
$db['default']['dbdriver'] = "mysql";
$db['default']['dbprefix'] = "";
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = "";
$db['default']['char_set'] = "utf8";
$db['default']['dbcollat'] = "utf8_general_ci";

Changing pconnect to FALSE didn't help.

Any advice is grealty appreciated.


MySQL Connection Issues - Dreamhost - El Forum - 05-22-2008

[eluser]James Gifford[/eluser]
It sounds like there is still an error in your database settings. Try triple-checking all the values. Maybe your username should be something like user_mysql? Maybe theres a typo in your databasename?

Only you know your server settings, so only you can be sure the values are all correct, but based on the error message there's a typo or incorrect value somewhere.


MySQL Connection Issues - Dreamhost - El Forum - 05-22-2008

[eluser]Crazy88s[/eluser]
I've tripled check the settings and they are correct. In addition to phypmyadmin, I logged in via SSH and using the mysql command line and I was able to connect.

I really don't know what the problem could be.


MySQL Connection Issues - Dreamhost - El Forum - 05-22-2008

[eluser]gtech[/eluser]
I don't really know what your problem is

the only difference in my config is that for mysql I am using the mysqli driver.
$db['default']['dbdriver'] = "mysqli";
$active_record = TRUE; instead I have $db['default']['active_r'] = TRUE;

could be a red herring though.

What version of php are you using as I have read in some forums they have had issues with php4 on dreamhost.


MySQL Connection Issues - Dreamhost - El Forum - 05-22-2008

[eluser]gtech[/eluser]
if you are trying to connect to the database from a different machine then the below link may also be useful

[url="http://blog.dreamhosters.com/kbase/index.cgi?area=2991"]http://blog.dreamhosters.com/kbase/index.cgi?area=2991[/url]

Quote:Note that if you're connecting from an IP that's not hosted with us (like say, your home or office) you'll need to add it through our web panel as an allowable IP to access your database!



MySQL Connection Issues - Dreamhost - El Forum - 05-22-2008

[eluser]Crazy88s[/eluser]
[quote author="gtech" date="1211504023"]if you are trying to connect to the database from a different machine then the below link may also be useful

[url="http://blog.dreamhosters.com/kbase/index.cgi?area=2991"]http://blog.dreamhosters.com/kbase/index.cgi?area=2991[/url]

Quote:Note that if you're connecting from an IP that's not hosted with us (like say, your home or office) you'll need to add it through our web panel as an allowable IP to access your database!
[/quote]

This worked. I've never had to do it before though. Very strange. Thanks for the help.


MySQL Connection Issues - Dreamhost - El Forum - 05-22-2008

[eluser]gtech[/eluser]
lol, that was a bit of a lucky guess.. cool glad you got it working