Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialJameson Cook
496 PointsClearing database tables for reinstall
I've had a Wordpress site for a time but neglected it, and am just now learning Wordpress. I'm trying to manually install the latest updated version of Wordpress but have reached a page that tells me this:
"To reinstall please clear your old database tables first."
Please advise how to do this, and/or where I can find my next steps.
Jameson Cook
496 PointsNow, I have multiple domains and multiple databases (and I don't know if some of my other domains have data stored on the same database as the one I need to "clear"), but I need to be 100% certain that this answer does not put any of my other domains' data on the database (or other databases) at risk.
Chris Akers
2,527 PointsYes, this method will ensure that any previous data currently in your MySQL database does not get cleared or overwritten with the new WordPress installation. The most important thing will be to use a table prefix that is not currently being used. If you have a way to view the table names (e.g. phpMyAdmin) then that will be the definitive way to ensure you are selecting a unique table prefix. Otherwise, if you can't verify what other prefixes are being used, you can use a prefix that is extremely unlikely to have been used previously. Something that incorporates the current date perhaps: $table_prefix = 'wp20130716_';
Jameson Cook
496 PointsI made the changes you suggested to my wp-config file, and sent the revised file through my FTP software, but when I refresh my webpage, I'm receiving an Internal Server Error.
Chris Akers
2,527 PointsMake sure that your modifications are made inside the single quotes on that line and that the line ends with a semicolon.
$table_prefix = 'wp20130716_';
Jameson Cook
496 PointsThat is all correct. Still receiving an error. I reviewed the wp-config.php file from my download folder, from the Remote Site list in Filezilla, and from the File Manager in cPanel, and they all look identical and correct.
Chris Akers
2,527 PointsWhen you navigate to <yourdomain.com>/wp-admin/install.php what do you see?
2 Answers
Courey Wong
14,445 Pointsthis was a great solution thanks
Daniel Donovan
847 PointsOpen up a new terminal and login to mysql and then type "show databases;" make a note of all your databases and then go back to your config files and make sure that your individual site's config file points to the correct database.
Jameson Cook
496 PointsThis has not been a problem.
Chris Akers
2,527 PointsChris Akers
2,527 PointsHello, Jameson.
The quickest way to get you up and running would be to modify your
wp-config.php
file. This will be a simple change of a text file rather than executing SQL in MySQL. The following steps will leave your old tables in place but add new ones for your new WordPress installation. Later, once you're all set up, it will be easier to go in and delete the unused tables.wp-config.php
(which is in your new WordPress installation's main directory) in a text editor.$table_prefix = 'wp_';
$table_prefix
so that it reads something different like:$table_prefix = 'wp2_';