Home » Web Developement » How to connect to your MySQL database in domain king

How to connect to your MySQL database in domain king

domainking

How to connect to your MySQL database in domain king

How to connect to your MySQL database

Establishing a MySQL database connection is must if you are designing or developing a dynamic website and also if youre doing so in domainking.

It is very important to connect your php script with your MYSQL database by using a specified php code which includes your Database Name, HostDatabase Username and Database Passwordotherwise your queries will be unable to call your database.

SELECTED JUST FOR YOU
Testing Flask applications using Unittest in python

When you are uploading/moving your database on the server, the database name and username may be different than your localhost Database usename & password. So it is important to make changes and updates in the code of your php script for your database to work online on the server.

If you have already created a database then you can easily check the name and username of your database in MySQL databases under databases section in your cPanel account.

SELECTED JUST FOR YOU
Securing data with PHP filter functions

Note: In a Shared Hosting Environment, you can’t change the database username without using the prefix of cPanel username as it by default.

You can use your cPanel username and password for connecting with your MySQL database. But we do not recommend the users to use their cPanel details as their MySQL Database Username & password. This is because if you will ever change your cpanel passwords then this will cause the database connection to stop working. So if you have changed the cPanel password accordingly you should make changes in your MySQL database connection script.

SELECTED JUST FOR YOU
The lingua franca of software: why you need to learn Javascript

Always use the following database configuration settings:

HOST = localhost

DATABASE NAME = cpanelUsername_databaseName

DATABASE USERNAME = cpanelUsername_databaseUsername

DATABASE PASSWORD = set by you (********)

Jason

Am a Software developer with a 3 year professional experience in several technologies not limited to PHP PYTHON and JavaScript, furthermore when am not coding or writing tech articles, you'll find me watching movies.

View all posts

Add comment

Your email address will not be published. Required fields are marked *