CodeIgniter Forums
Setup multiple database in multiple environment - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Installation & Setup (https://forum.codeigniter.com/forumdisplay.php?fid=9)
+--- Thread: Setup multiple database in multiple environment (/showthread.php?tid=80273)



Setup multiple database in multiple environment - dev02 - 10-11-2021

Hi,
I am setup the database, but have this situation, I haveĀ 3 database localhost1, localhost2, localhost3 and I need setup this 3 database in my environment development, tests and production, how can do this?


RE: Setup multiple database in multiple environment - dev02 - 10-11-2021

I am using a codeigniter 4


RE: Setup multiple database in multiple environment - includebeer - 10-12-2021

The easier way to do that is having a different .env file on each server with the right configuration for each environment.
See this page for more info: http://codeigniter.com/user_guide/general/environments.html


RE: Setup multiple database in multiple environment - janakcs - 10-26-2021

Facing the same database connection problem but I have the solution provided in this thread is helpful for me.