{"id":651,"date":"2021-06-05T16:42:51","date_gmt":"2021-06-05T11:12:51","guid":{"rendered":"https:\/\/mediastroke.com\/blog\/?p=651"},"modified":"2022-07-01T13:17:25","modified_gmt":"2022-07-01T07:47:25","slug":"php-mysql-connection","status":"publish","type":"post","link":"https:\/\/mediastroke.com\/blog\/php-mysql-connection\/","title":{"rendered":"PHP MySQL Connection Using cPanel Hosting"},"content":{"rendered":"\n
PHP MySQL connection setting up on a cPanel hosting is generally challenging for beginners. To make things simple, we have created this guide, which offers a detailed overview of how to set up a MySQL database and connect it to a PHP application using cPanel hosting. This article also explains about how to deploy a local project (running on XAMPP, LAMP, WAMP, etc.) in cPanel Hosting.<\/p>\n\n\n\n
To make your PHP project with MySQL live, just follow below simple steps.<\/p>\n\n\n\n
To setup MySQL database in cPanel, basically you need to create MySQL Database, create MySQL User, assign User to Database & manage User Privileges and import database using .sql file. Steps for the same are explained in below sections:<\/p>\n\n\n\n
You have to create a MySQL User and give the necessary privileges, before they may access and control the database.<\/p>\n\n\n\n
Note:<\/strong> Remember to save the database name, username, and password to use in PHP programs to connect to the database.<\/p>\n\n\n\n Now as we have both a MySQL Database and a MySQL User, we must assign the MySQL User to the Database in order to set the appropriate privileges. To do this, follow the below steps:<\/p>\n\n\n\nAssign User to MySQL Database:<\/h3>\n\n\n\n