WordPress Configuration – How To Edit Your wp-config.php File

If you are installing WordPress manually you’ll need to edit your wp-config.php file so your WordPress files connect to your database. If you have installed WordPress using cPanel script for one click installation provided by a WordPress web host then you won’t need to access your wp-config.php file..

If you ever have a problem with your wp-config.php file and are using any of these web hosts then i know for a fact they will help you fix the problem and are trained and experienced in respect of the WordPress file system.

Use the wp-config.php sample file to create your own wp-config file if you are installing WordPress manually. You can edit your wp-config.php file and/or sample file using the built in text editor in your cPanels File Manager or download it to your local machine and edit it there after which you’ll need to upload it again.

How To Edit Your wp-config.php file Using File Manager

Login to your cPanel and locate the file which is located in your public-html

cPanel-File Manager-public_html-Wp-Config.php

Click on your wp-config.php file and highlight it like in the above screen shot. Right click and either click Code Edit or Download.

edit wp-config.php file

You may need to edit this file if you are moving WordPress to a new host, domain or server manually or installing WordPress manually. When you install WordPress using an automatic one click installation script, it creates a wp-config.php file for you.

The wp-config file is NOT included in a manual download of WordPress so you’ll need to use the wp-config.php Sample file and edit it with your database settings.

You can view a complete copy of what a wp-config.php-Sample File looks like here.

The information you will be setting is as follows:

  1. Database Name – Database Name used by WordPress
  2. Database Username – Username used to access Database
  3. Database Password – Password used by Username to access Database
  4. Database Host – The hostname of your Database Server

These fields which need to be set look like this:

/** The name of the database for WordPress */
define(‘DB_NAME’, ‘database_name_here’);

/** MySQL database username */
define(‘DB_USER’, ‘username_here’);

/** MySQL database password */
define(‘DB_PASSWORD’, ‘password_here’);

/** MySQL hostname */
define(‘DB_HOST’, ‘localhost’);

You should have saved this information when you created a new database for WordPress using the MySQL Database Wizard in your web hosts cPanel.

The last settings ‘local host’ should not need to be changed unless your web host uses another name. I know Bluehost & Hostgator use localhost for the hostname so you can simply leave this setting unchanged if you are also using either of these 2 web hosts.

There are other advanced settings you may need to edit at some stage down the track however your database settings are edited most often.

Posts Related to WordPress Configuration

  1. WordPress Database-How To Create a Database for WordPress
  2. wp-config.php-Sample File
  3. Using cPanel to Backup & Restore MySQL Databases
  4. MySql Database for WordPress
  5. What is a Web Host?

Comments

One response to “WordPress Configuration – How To Edit Your wp-config.php File”

  1. […] a tutorial on how to edit your wp-config.php file which will connect your database to your […]

Leave a Reply

Join 5000+ Followers

Get The Latest Free & Premium Tutorials Delivered The Second They’re Published.