mysql connection refused |
(06-26-2018, 03:36 PM)jameshking Wrote: I am a beginner with CI and I am working my way through the tutorials on your site as well as some others I found through googling. Everything works fine until I encounter a part of the tutorial that requires interface to mysql. I have tried many suggestions found through googling, but so far nothing works. I have a simple controller that echos Hello world and then tries to $this->load->database(); This fails with connection refused error. This is my current database connection configuration: Hi! This doesn't look like a CI issue. My first (relatively educated) guess would be that the hostname should be just 'localhost' instead of localhost:/db01/var/lib/mysql/mysql.sock just to make sure, could you confirm that the mysql service is running on the same machine as your application? do you have SSH access to your server? If yes, can you log in and then try to log into it by typing mysql -h localhost -u jking -pmypassword (no space between -p and mypassword) If you can in fact log in, we can at least rule out a credentials issue. If you are on shared hosting environments (Dreamhost comes to mind) keep in mind that many won't accept using 'localhost' as the db hostname even if your code and your DB are on the same server (Dreamhost, for instance, forces you to use a FQDN for the database, which usually defaults to mysql.yourdomain.com). Check if your hosting provider has a similar constraint in place or try replacing 'localhost' as the hostname in your CI configuration with the actual IP or hostname of the db server let me know if anything from the above works ![]()
Javier Larroulet
|
Messages In This Thread |
mysql connection refused - by jameshking - 06-26-2018, 03:36 PM
RE: mysql connection refused - by jlarroulet - 06-26-2018, 05:58 PM
RE: mysql connection refused - by jameshking - 06-26-2018, 06:46 PM
RE: mysql connection refused - by InsiteFX - 06-27-2018, 03:09 AM
RE: mysql connection refused - by jameshking - 06-27-2018, 03:07 PM
RE: mysql connection refused - by alamowais - 07-24-2018, 09:50 AM
|