What is the filename (including path) of a WordPress database?

4

I have local Wordpress database that got corrupt as a result of an abrupt power outage (I wasn't even editing it!).

Since the system I am dealing with is pretty static (and old), I just want to restore that database file (or collection of files) from a nightly backup.

But I don't know which files I should be restoring. The WordPress blog in question is installed under a local user account in an old Linux server (FC4).

I checked the wp-content directory, but apparently this is not where the content is:

~/public_html/wordpress/wp-content> ls -l
total 24
-rw-r--r--  1 ww4s ww4s   32 Nov 18  2005 index.php
drwxr-xr-x  3 ww4s ww4s 4096 Jun  2  2006 plugins
drwxr-xr-x  4 ww4s ww4s 4096 Mar 10  2006 themes

Any idea which file(s) I should be restoring and what their path is?

WinWin

Posted 2011-06-17T14:18:32.923

Reputation: 850

Answers

6

WordPress is almost certainly using a MySQL database for storing its content, and those are usually stored elsewhere on the system, often /var/lib/mysql/some_db_name. Open up your wp-config.php file and start looking at your MySQL settings. These should help you figure out your environment and where to look next. You can see a sample wp-config.php file here.

John

Posted 2011-06-17T14:18:32.923

Reputation: 410

Indeed, my version of WordPress is using MySQL, and the databases are stored in directories /var/lib/mysql - a path pointed to by the variable datadir in /etc/my.conf (one directory per database). Thanks + 1 + Accepting. – WinWin – 2011-06-17T22:49:13.703