Connecting to Local MySQL and Remote MySQL in PHP
Channel: Christian Hur
Date: 2022-03-24

⭕ Overview
Hello, this is Christian. In this video, I will show you how to work with PHP and connect to both local and remote database systems. We'll use PHPStorm to manage our projects and databases.

First, I'll show you my local project setup in PHPStorm, connected to a local database and a remote server using FTP. The remote server is hosted on Prometheus. Both the local and remote databases have identical structures and data, ensuring consistency across environments.

We begin by exploring the database connections in PHPStorm. You'll see two connections: one to the local database and one to the remote database. Both databases contain the same tables and data, which I'll demonstrate by opening and comparing the content.

Working locally allows you to develop and test your applications without affecting the live server. Once you're satisfied with your local changes, you can transfer your files to the remote server. It's crucial to ensure that your local and remote databases are in sync to avoid discrepancies.

Next, I'll explain the connection methods to these databases. For local connections, the IP address is typically `127.0.0.1` or `localhost`. For remote connections, you'll use the server's IP address or hostname provided by your hosting service.

By following this setup, you'll be able to develop and maintain your PHP applications efficiently, leveraging both local and remote databases for a seamless development workflow.

If you find this video helpful, please give it a thumbs up, share it with your friends, and subscribe to my channel for more tutorials and insights into programming. Your support helps me create more content to assist you in your learning journey. Thank you for watching!

Diagram:  https://docs.google.com/drawings/d/1YmYwSyyOmzG1Q_QI2yJoZ99B-jZf9EyOrQyeqC9_qgc/edit?usp=sharing

⭕ Chapters
  0:00 - Introduction

⭕ About me
I am a Web Instructor at Gateway Technical College, an Adjunct Professor at Boston University Metropolitan College, Web Instructor at University of California, Irvine - Division of Continuing Education.

⭕ Visit my site: https://christianhur.com
⭕ My complete online training courses:
      ☑️ REST APIs & AJAX Operations Using Node, Express, and jQuery:  https://www.udemy.com/course/rest-apis-ajax-operations-using-node-express-and-jquery/?referralCode=A762AE70D9FD6A931F9B
      ☑️ Build Clean and Secure PHP Web Apps From Scratch:  https://www.udemy.com/course/build-clean-and-secure-php-web-apps-from-scratch/?referralCode=C200BB52F0C7153B93CC
      ☑️ Angular 9 New Features: https://www.packtpub.com/web-development/angular-9-new-features-video
      ☑️ Full-Stack Web Development with Flask: https://www.packtpub.com/web-development/full-stack-web-development-flask-video
      ☑️ Full-Stack Web Development with Django & Angular 8: https://www.packtpub.com/web-development/full-stack-web-development-with-django-and-angular-8-video
      ☑️ Angular 7 New Features:  https://www.packtpub.com/web-development/angular-7-new-features-video
      ☑️ The DOM in JavaScript, jQuery, AngularJS, and React : https://www.linkedin.com/learning/the-dom-in-javascript-jquery-angularjs-and-react
      ☑️ Building JSF Web Applications with Java EE 7:  https://www.linkedin.com/learning/building-jsf-web-applications-with-java-ee-7
      ☑️ Troubleshooting Vue.js:  https://www.packtpub.com/application-development/troubleshooting-vuejs-video

⭕ Check out my book:
Developing Business Applications for the Web: With HTML, CSS, JSP, PHP, ASP.NET, and JavaScript is available on Amazon and MC Press. 
      ☑️ Link:  https://www.mc-store.com/collections/christian-hur/products/developing-business-applications-for-the-web-with-html-css-jsp-php-asp-net-and-javascript