WordPress:Restoring Your Database From Backup

来自站长百科
Xxf3325讨论 | 贡献2008年6月2日 (一) 14:11的版本 (新页面: == Using phpMyAdmin == WordPress:phpMyAdmin is a program used to manipulate databases remotely through a web interface. A good hosting package will have this included. For informatio...)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳转至: 导航、​ 搜索

Using phpMyAdmin

WordPress:phpMyAdmin is a program used to manipulate databases remotely through a web interface. A good hosting package will have this included. For information on backing up your WordPress database, see WordPress:Backing Up Your Database.

Information here has been tested using WordPress:phpMyAdmin 2.8.0.2 running on Unix.

Restore Process

A visual tutorial for phpMyAdmin 2.5.3 can be found at Podz' WordPress Restore guide.

  1. Login to WordPress:phpMyAdmin.
  2. Click databases, and select the database that you will be importing your data into.
  3. You will then see either a list of tables already inside that database or a screen that says no tables exist. This depends on your setup.
  4. Across the top of the screen will be a row of tabs. Click the Import tab.
  5. On the next screen will be a Location of Text File box, and next to that a button named Browse.
  6. Click Browse. Locate the backup file stored on your computer.
  7. Make sure the SQL radio button is checked.
  8. Click the Go button.

Now grab a coffee. This bit takes a while. Eventually you will see a success screen.

If you get an error message, your best bet is to post to the WordPress support forums to get help.

Using Mysql Commands

The restore process consists of unarchiving your archived database dump, and importing it into your Mysql database.

Assuming your backup is a .bz2 file, creating using instructions similar to those given for Backing up your database using Mysql commands, the following steps will guide you through restoring your database :

1. Unzip your .bz2 file:

user@linux:~/files/blog> bzip2 -d blog.bak.sql.bz2

Note: If your database backup was a .tar.gz called blog.bak.sql.tar.gz file, then, tar -zxvf blog.bak.sql.tar.gz is the command that should be used instead of the above.

2. Put the backed-up SQL back into MySQL:

user@linux:~/files/blog> mysql -h mysqlhostserver -u mysqlusername
 -p databasename < blog.bak.sql

Enter password: (enter your mysql password)
user@linux~/files/blog:>