0

I have a MySql DB in my VPS that can access by remote. I already try this tutorial to open remote my DB in VPS. This is the link

then, I have a CodeIgniter application that must be connected to that MySql DB.

There are the scheme:

  1. The CodeIgniter app in my localhost, set the DB configuration to that MySql DB. It Work

  2. The CodeIgniter app in my Shared hosting, set the DB configuration to that MySql DB. Error

I attach the error log, below here

enter image description here

Charles
  • 1,121
  • 19
  • 30
aisid
  • 1
  • Then it must be something wrong with your configuration. Recheck the IP address, the username, password and database name you're trying to access. – Fredster Aug 02 '17 at 14:09
  • Hmmm. Might be relevant to mention the environments. What operating system, PHP versions, etc on the different environments? Is cPanel and/or mod_security or something similar installed on any of the environments? – Goose Aug 02 '17 at 14:26
  • @Fredster The IP address, username, password, and database name setting in my localhost and VPS are same, cause it use same application. – aisid Aug 06 '17 at 16:31
  • @Goose I use Ubuntu 16.04, PHP 5.6. I use Vesta CP. I am still search the solution in other place. I am assume it cause by mod_security or firewall in my VPS. If you have any clue / solution / question, I would like to hear it. – aisid Aug 06 '17 at 16:33

1 Answers1

2

firewall of the server must be set-up to enable incomming connections on port 3306 you must have a user in MySQL who is allowed to connect from % (any host) (see manual for details) The current problem is the first one, but right after you resolve it you will likely get the second one.

Armen Grigoryan
  • 521
  • 2
  • 9
  • I am still search how to set up the VPS firewall. If you have any clue, I like to hear it. – aisid Aug 06 '17 at 16:35