简体   繁体   English

共享托管中的Codeigniter应用程序无法连接到VPS中的远程MySQL

[英]Codeigniter app in shared hosting can't connect to remote mysql in vps

I have a MySql DB in my VPS that can access by remote. 我的VPS中有一个MySql数据库,可以通过远程访问。 I already try this tutorial to open remote my DB in VPS. 我已经尝试过本教程在VPS中远程打开我的数据库。 This is the link 这是链接

then, I have a CodeIgniter application that must be connected to that MySql DB. 然后,我有一个必须连接到该MySql DB的CodeIgniter应用程序。

There are the scheme: 有方案:

  1. The CodeIgniter app in my localhost , set the DB configuration to that MySql DB. 我的本地主机中的CodeIgniter应用程序将数据库配置设置为该MySql数据库。 It Work 这行得通

  2. The CodeIgniter app in my Shared hosting , set the DB configuration to that MySql DB. 我的共享主机中的CodeIgniter应用程序将数据库配置设置为该MySql数据库。 Error 错误

I attach the error log, below here 我在下面附上错误日志

在此处输入图片说明

必须设置服务器防火墙以启用端口3306上的传入连接,您必须在MySQL中拥有一个允许从%(任何主机)进行连接的用户(有关详细信息,请参见手册)。当前问题是第一个,但是正确的解决它之后,您可能会得到第二个。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM