{"id":5099,"date":"2019-10-09T10:45:14","date_gmt":"2019-10-09T05:15:14","guid":{"rendered":"https:\/\/pheonixsolutions.com\/blog\/?p=5099"},"modified":"2019-10-09T10:45:16","modified_gmt":"2019-10-09T05:15:16","slug":"how-to-connect-mysql-database-remotely-using-codeigniter","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/how-to-connect-mysql-database-remotely-using-codeigniter\/","title":{"rendered":"How to Connect MySQL Database Remotely using Codeigniter"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">\u00a0How to Connect MySQL Database Remotely using Codeigniter<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">Date : 08\/10\/2019<\/h4>\n\n\n\n<h4 class=\"wp-block-heading\">Introduction<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">You can connect remote database with other for development in <em>codeigniter<\/em> project development.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">There are few things have to checked to connect remote database for your <em>codeigniter<\/em> project.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The checks are summarised in the following.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Enter valid details in database.php file<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Check you have entered right details about the database in your <code>database.php<\/code> file.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"640\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/10\/Screen-Shot-2019-10-09-at-10.27.38-AM-1024x640.png\" alt=\"\" class=\"wp-image-5100\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/10\/Screen-Shot-2019-10-09-at-10.27.38-AM-1024x640.png 1024w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/10\/Screen-Shot-2019-10-09-at-10.27.38-AM-300x188.png 300w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/10\/Screen-Shot-2019-10-09-at-10.27.38-AM-768x480.png 768w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/10\/Screen-Shot-2019-10-09-at-10.27.38-AM-400x250.png 400w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/10\/Screen-Shot-2019-10-09-at-10.27.38-AM.png 1440w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption><br><\/figcaption><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">Allow host address for remote database<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Make sure your host address allowed to access the database in remote server. Probably via Cpanel.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" width=\"1024\" height=\"296\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/10\/Screen-Shot-2019-10-09-at-10.29.28-AM-1024x296.png\" alt=\"\" class=\"wp-image-5101\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/10\/Screen-Shot-2019-10-09-at-10.29.28-AM-1024x296.png 1024w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/10\/Screen-Shot-2019-10-09-at-10.29.28-AM-300x87.png 300w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/10\/Screen-Shot-2019-10-09-at-10.29.28-AM-768x222.png 768w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/10\/Screen-Shot-2019-10-09-at-10.29.28-AM.png 1382w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">Check your local machine<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Ensure your local machine was being allowed to access remote database.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To verify mysql configuration file check <em><code>bind-address<\/code><\/em> 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.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If your are using mac, check inside my.cnf.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Check remote server firewall<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Make sure your IP allowed in the remote server firewall rules.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Conclusion<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Thank you for using pheonixsolutions. If you find it useful, please share it with your friends.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u00a0How to Connect MySQL Database Remotely using Codeigniter Date : 08\/10\/2019 Introduction You can connect remote database with other for [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1022],"tags":[605,179,273],"class_list":["post-5099","post","type-post","status-publish","format-standard","hentry","category-web-architecture","tag-codeigniter-framework","tag-mysql-2","tag-php","psol-cat-web-architecture"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/phn2x7-1kf","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/5099","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=5099"}],"version-history":[{"count":0,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/5099\/revisions"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=5099"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=5099"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=5099"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}