This article helps you to understand How to create database connection in wordpress.
This article consists of following topics:
- Why I need so?
- How can do it myself without impacting websites?
- Difficulty level [Easy, Medium, Hard].
- Total time consumed.
Why i need to do so?
To create database connection follow the steps:
Create a database:
After Login cPanal open cPanal window look like:
Step1: Write Database Name(my_db1)
Step2: Click on Create Database
Step1: Write Username(anju)
Step2: Type Password
Step3: Retype Password
Step4: Click on Create User
Step1: Select user by drop-down menu
Step2: Select database by drop-down menu
Step1: Check the box All Privileges
Step2: Click on Make Changes
Step1: Go to files and click on File Manager
Edit database login settings in wp-config:
Step1: Click on your website folder
Step2: right click on wp-config.php file
Step3: Click on code edit
Edit wp-config.php file
Step1: check your details
As you can see, there are four information WordPress needs to access your database:
- The name of the database (“DB_NAME”)
- The login username (“DB_USER”)
- The login password (“DB_PASSWORD”)
- The database host (“DB_HOST”)
Step2: If there is any error then correct the information
Step3: Click on save change
Refresh your browser , and your website running normally.