Connecting to a remote database through CodeIgniter

那年仲夏 提交于 2019-11-29 07:07:09

try this command from your shell to see if you can connect:

mysql -h HOSTNAME -uUSERNAME -p DATABASE

also check to see if you don't have a different port to connect to mysql set, by default codeigniter will connect to 3306, unless you define the actual port set. this might be the issue.

good luck

mysql by default accepts only localhost connections, make sure your server is configured properly locally

http://www.cyberciti.biz/tips/how-do-i-enable-remote-access-to-mysql-database-server.html

make sure that your server isn't behind a router that's in a private subnet, you might neet to configure static NAT for portforwarding your server into the web

Mia Torres
$active_group = 'staging';
$active_record = TRUE;

try to change above code to

$active_group = 'default';
$active_record = TRUE;

If you have enforced SELinux Policy in your server make sure you enable httpd_can_network_connect boolean flag

setsebool -P httpd_can_network_connect=1
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!