How to Connect MySQL Database Remotely using Codeigniter

Date : 08/10/2019

Introduction

You can connect remote database with other for development in codeigniter project development.

There are few things have to checked to connect remote database for your codeigniter project.

The checks are summarised in the following.

Enter valid details in database.php file

Check you have entered right details about the database in your database.php file.


Allow host address for remote database

Make sure your host address allowed to access the database in remote server. Probably via Cpanel.

Check your local machine

Ensure your local machine was being allowed to access remote database.

To verify mysql configuration file check bind-address line in it. If it points to 127.0.0.1, change it to 0.0.0.0. 0.0.0.0 means allowing all IP addresses.

If your are using mac, check inside my.cnf.

Check remote server firewall

Make sure your IP allowed in the remote server firewall rules.

Conclusion

Thank you for using pheonixsolutions. If you find it useful, please share it with your friends.

Leave a Reply