Download our exclusive 10-Point WP Hardening Checklist: http://bit.ly/10point-wordpress-hardening-checklist
Edit wp-config.php To Add WordPress Database Credentials | WP Learning Lab
In another video (here: https://youtu.be/wtG1IJ1Wbvs) I showed you how to create a MySQL database for your WordPress site. In this video I'm going to show you how to edit wp-config.php file to include the database credentials.
Although many people will be intimidated by it, editing wp-config.php is quite easy once you know the steps. So I encourage you try.
The first thing you must do to edit config file is log into the root directory of your WordPress site. You can do this via FTP or the file manager in your hosting account, whatever you're most comfortable with.
Find a file called wp-config-sample.php and open it for editing wp-config.php. Scroll down to where it says MySQL Settings. Just below that you will see three important entries:
1. define('DB_NAME', 'database_name_here');
2. define('DB_USER', 'username_here');
3. define('DB_PASSWORD', 'password_here');
Carefully replace database_name_here with the MySQL database name you created. Make sure that the single quotes stay, you only want to replace the text database_name_here.
Replace username_here with the username you created and replace password_here with the password you created.
That's all you need to install WordPress. You can save the file and exit or you can do a couple more tweaks that will make your site more secure.
If you want to exit now, simply save the file and close the text editor. Then make sure you change the file name from wp-config-sample.php to wp-config.php.
If you want to make some security tweaks then keep reading.
Scroll down in the wp config file to where it says Authentication Unique Keys and Salts. Keys and salts are unique characters that WordPress uses to make usernames and passwords extra hard for hackers to guess.
Go to the URL that is the instructions for the keys and salts (https://api.wordpress.org/secret-key/1.1/salt/). Refresh the page that loads a few times and then copy and paste the block of code that appears on that page. Paste that code block into the wp-config.php file replacing the demo code that exists. And you're done with the unique keys and salts.
After that you can scroll down to where it says WordPress Database Table Prefix. By default the database prefix is wp_ and every hacker knows that. Every hacker also knows that 99% of webmasters don't change the prefix. Hackers can take advantage of this information to gain access to your database. This is easily avoided.
Simply change the database table prefix to something random. You can only use letters and numbers and the underscore needs to be kept at the end of the prefix. For example, instead of wp_ you could make the prefix be tomfoolery_. The latter is much more difficult for a hacker to guess.
That's it for basic wp-config.php security. You can now save the file, exit and rename it to wp-config.php.
I hope this information helps you! If you have any questions leave a comment below or ping me @WPLearningLab on Twitter.
All videos in the WP Learning Lab WordPress Installation Series:
1. WordPress Installation Introduction https://youtu.be/7jiMRKYcjq0
2. Buying A Domain Name For Your Website (From GoDaddy) - Tips & Tricks of the Pros https://youtu.be/qThIPLjjW5Y
3. WordPress Hosting: Buying A (BlueHost) Hosting Account for Your Website https://youtu.be/Amlw0VKbtRU
4. Setting Name Servers In Your GoDaddy Domain Registrar Account https://youtu.be/mlWBm4nL3R8
5. Create Add On Domains via cPanel https://youtu.be/vOjKns89Rj0
6. Downloading and Uploading WordPress.org (Self Hosted WordPress) Files https://youtu.be/O6IgVyxusro
7. Create a MySQL Database for your WordPress Site via cPanel https://youtu.be/wtG1IJ1Wbvs
8. Edit wp-config.php To Add WordPress Database Credentials https://youtu.be/QRKigi4ek_g
9. WordPress Installation Form & Logging In For The First Time https://youtu.be/qDGRcGTFOjs
10. WordPress One Click Install https://youtu.be/5L5fGL5egGk
11. Create A Custom Email Address For Your Website Via cPanel https://youtu.be/q4_1CeSU8XM
12. Forward Your Custom Email Address via cPanel https://youtu.be/n7sm8b5gUVY
13. WordPress Installation Series Conclusion & Next Steps https://youtu.be/ZJ3-gf3c-9o
--------------
If you want more excellent WordPress information check out our website where we post WordPress tutorials daily.
http://wplearninglab.com/
Connect with us:
WP Learning Lab Channel: http://www.youtube.com/subscription_center?add_user=wplearninglab
Facebook: https://www.facebook.com/wplearninglab
Twitter: https://twitter.com/WPLearningLab
Google Plus: http://google.com/+Wplearninglab
Pinterest: http://www.pinterest.com/wplearninglab/