Where on one's server is the mySQL database that goes with a WordPress blog?
Asked by
anartist (
14813)
January 4th, 2011
I can’t find it in any of the blog files, or in any of the files in any directory under my domain home [not the public html home but the main home]
Can I find it and copy it to my local machine?
Observing members:
0
Composing members:
0
5 Answers
just search for .mdb and .ldf
As I understand it, MySQL stores it’s files in a whole bunch of pieces that you probably can’t just copy over. The MySQL instance running on your local machine will likely not recognize them. Instead, use the mysqldump tool to generate a .sql file, then import the file on your local machine. You’ll need to fire up your command line (called the “terminal” on Mac/Linux) and use these commands, replacing username, password, and databasename with your pertinent information:
On your server:
mysqldump -u username -ppassword databasename > file.sql
Download the file from your server to your local machine, then:
mysql -u username -ppassword databasename < file.sql
That should do it!
Wordpress has a feature that allows you to do a export. Then you can import it into the install on the local machine. It is in the admins section under Tools.
And check to see if your host has PHPadmin on it. You can grab the sql file from PHPadmin easily.
Thank you all very very much!
Also note that it is not uncommon for databases to be running a separate server from the content. The point of using a DBMS is so you never have to look at files. If you’re looking to backup, then mysqldump is what you’re looking for. If you want to browse you database, you can use a PHP front end like phpMyAdmin.
Answer this question
This question is in the General Section. Responses must be helpful and on-topic.