BlueCapra

Using Technology To Solve Problems and Create Solutions

  • About Alan Reeves
  • Curiosity & Learning
  • Projects

My WordPress How-to: Changing a Password

December 15, 2011 by Alan R Leave a Comment

Wp-config-sample.php from WordPressYou can really mess up your WordPress website.  If you don’t know what you are doing, things can go from bad to worse very quickly, especially if you go changing your password.  I was trying to figure out a strange issue that resulted in my site title showing up twice when a post was shared on Facebook.  It ended up being how I structured the permalink (I think…), but that is another story.  I had the bright idea to go into the database administration and have a look around.  It was then the problems started.

Whatever you do, don’t change your password

I could not remember my database administration password.  I did not write it down (good and bad).  I needed to change it so I could access the database administration area via phpMyAdmin.  I went to my hosting control panel (at GoDaddy) and reset the password.  At that time, my site could not communicate with the database.  Being written in PHP, databases store EVERYTHING in WordPress.  Not being able to communicate with the database is, in a word, bad.  Of course, I had not backed up my site and downloaded my content (I did have access to FTP, so I was not completely dead in the water).  Since I had reset the password and could not undo that, I was stuck… or was I?

I have a little background in PHP.  After deciding to learn more about it, I began to build what I call an online application (basically a website to keep up with automobile maintenance running on a local server).  I struggled and built for months and enjoyed every minute.  If nothing else, that first foray into PHP programming provided me with a vague understanding of the syntax and better, the file structure.

The fix

So, I had a database my pages could not communicate with.  I had a brand new password that was useless.  How was I going to fix this?  Google was of little help.  Apparently, all the help pages deal with resetting your WordPress password if you can access the MySQL server or phpMyAdmin.  I had a similar but much too different problem.  After about half an hour of searching, I recalled some information about the PHP file structure.  That made all the difference in the world.

To be useful, PHP must establish a connection with the database.  Hard coded somewhere on your site (in plain text), there should be the name or address of the server your site is located on (even if it is local), the user name for the login, and… wait for it… the password.  This information is hard coded in a PHP page and the information in that page is included with every PHP page that needs access to the database.  Since the password is in a file that is not accessible to the public, the password is safe while accessible to the pages when needed.  After finding wp-config.php via FTP, all I had to do is change the password there (which is what I did) or copy the password and change it on the server to match.  A very simple fix to what could have been a massive problem.

What did I learn?  I learned that I could actually stay calm in the face of losing over six months worth of posts.  I realized most problems are not as bad as they seem.  I learned not to mess with passwords unless I have NO other choice.  Hope this how-to helps you and may you never have this problem.

For other WordPress How-To articles, check out the related post section below or in the right sidebar or click here.

Filed Under: How-To Tagged With: how-to, passwords, php, Wordpress

Leave a Reply Cancel reply

You must be logged in to post a comment.

Find what you are looking for

Books I've Read

48 Days to the Work You Love
Being Wrong: Adventures in the Margin of Error
How Doctors Think
The Art of Possibility: Transforming Professional and Personal Life
Dirty Rotten Strategies: How We Trick Ourselves and Others into Solving the Wrong Problems Precisely
Brainstorm: Harnessing the Power of Productive Obsessions
The Creative Habit: Learn It and Use It for Life
A Book of Five Rings: The Classic Guide to Strategy
Wild at Heart: Discovering the Secret of a Man's Soul
Reality Check: The Irreverent Guide to Outsmarting, Outmanaging, and Outmarketing Your Competition
Startup Guide to Guerrilla Marketing: A Simple Battle Plan For Boosting Profits
Vagabonding: An Uncommon Guide to the Art of Long-Term World Travel
Seeking Wisdom: From Darwin To Munger
Multiple Streams of Internet Income: How Ordinary People Make Extraordinary Money Online
Thomas Paine: Enlightenment, Revolution, and the Birth of Modern Nations
The War of Art: Break Through the Blocks & Win Your Inner Creative Battles
The 4-Hour Workweek: Escape 9-5, Live Anywhere, and Join the New Rich
Where Good Ideas Come From: The Natural History of Innovation
Moonwalking with Einstein: The Art and Science of Remembering Everything
Build Your Own Wicked Wordpress Themes


Alan Reeves's favorite books »

Copyright © 2025  ·  BlueCapra.com  ·  Built on the Genesis Framework and Centric child theme   ·  Affiliate Disclosure

Copyright © 2025 · Centric Theme on Genesis Framework · WordPress · Log in