![]() |
MySQL : "Unable to connect to your database server using the provided settings." But I can connect manually. - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: MySQL : "Unable to connect to your database server using the provided settings." But I can connect manually. (/showthread.php?tid=6619) Pages:
1
2
|
MySQL : "Unable to connect to your database server using the provided settings." But I can connect manually. - El Forum - 03-05-2008 [eluser]veddermatic[/eluser] I have a new CI 1.6.1 install. In my application/config/database.php file I have the host, username, pass, and db names set. The MySQL is version 5.0.2. I have other CI based sites running, and have gotten database connectivity no problems. When I call Code: $this->load->database() However, if I just use the raw PHP: Code: mysql_connect('mysql.myhost.com','myuser','mypass') or die("uh oh: ".mysql_error()); It connects fine, and I can run queries and all is well. I have copy / pasted the working values from the raw PHP into the database.php file, so it's not a typo or anything of that nature. That file looks like: Code: $db['default']['hostname'] = "mysql.myhost.com"; php.ini confirms that persistant connections are enabled, charset and collation match. This is my first 1.6.X site (all my other CI sites are 1.5.x) so is there some "duuuh" setting somewhere I need to set, or? MySQL : "Unable to connect to your database server using the provided settings." But I can connect manually. - El Forum - 03-05-2008 [eluser]Michael Wales[/eluser] Have you tried turning off pconnect (even though php.ini says persistent connections are enabled)? MySQL : "Unable to connect to your database server using the provided settings." But I can connect manually. - El Forum - 03-05-2008 [eluser]veddermatic[/eluser] [quote author="Michael Wales" date="1204775194"]Have you tried turning off pconnect (even though php.ini says persistent connections are enabled)?[/quote] Yup, same issue. MySQL : "Unable to connect to your database server using the provided settings." But I can connect manually. - El Forum - 03-05-2008 [eluser]veddermatic[/eluser] OK.. in a very odd and confounding twist, it now works. What did change? I replaced the double quotes around the hostname in the config file with single quotes. Code: $db['default']['hostname'] = "mysql.myhost.com"; Causes the error while: Code: $db['default']['hostname'] = 'mysql.myhost.com'; Works just fine. No other setting changed or anything. Now to go bandage my head where I have been smashing it against my desk. MySQL : "Unable to connect to your database server using the provided settings." But I can connect manually. - El Forum - 12-26-2008 [eluser]ixxalnxxi[/eluser] This very strange phenomenon happened with me also, I replaced the double quotes with single quotes and that error no longer showed up. MySQL : "Unable to connect to your database server using the provided settings." But I can connect manually. - El Forum - 01-16-2009 [eluser]Unknown[/eluser] I had the same problem too. (I'm using CI 1.7.0) I think it might have something to do with the server set-up as well. Things worked well on with my old host - then I transfered everything to a new host and received this error. I changed the double quotes to single ones in the database config file(as suggested earlier) and all seems to work well so far. MySQL : "Unable to connect to your database server using the provided settings." But I can connect manually. - El Forum - 02-02-2010 [eluser]Unknown[/eluser] [quote author="Michael Wales" date="1204775194"]Have you tried turning off pconnect (even though php.ini says persistent connections are enabled)?[/quote] Had the same problem but w/o persistent connections. I didn't even know to look for it. Turning pconnect off solved it for me. Thanks Michael MySQL : "Unable to connect to your database server using the provided settings." But I can connect manually. - El Forum - 03-10-2010 [eluser]Unknown[/eluser] Just spent some time having a similar issue... Thanks to suggestions here, i finally figured that port was missing! ...and that because of default php.ini of osx > "mysql.default_port = " thanks ![]() MySQL : "Unable to connect to your database server using the provided settings." But I can connect manually. - El Forum - 01-27-2011 [eluser]Unknown[/eluser] set $db['default']['pconnect'] = FALSE; oK~~~~ MySQL : "Unable to connect to your database server using the provided settings." But I can connect manually. - El Forum - 08-04-2013 [eluser]Unknown[/eluser] I changed $db['default']['db_debug'] = TRUE; to $db['default']['db_debug'] = FALSE; and its working now ![]() |