1. Home
  2. Computing & Technology
  3. PHP / MySQL
photo of Angela Bradley
Angela's PHP / MySQL Blog

By Angela Bradley, About.com Guide to PHP / MySQL

Restore Your MySQL Database

Wednesday April 5, 2006
Restoring a MySQL database that has been removed is very easy if you have made a backup. You can also use this method to move an old database to a new server. It can be restored with a single line from the command prompt. Simply run: mysql - u user_name -p your_password database_name < file_name.sql
Comments
April 5, 2006 at 1:58 pm
(1) Justin says:

How do I restore a database that hasn’t been removed? Thanks.

April 5, 2006 at 2:19 pm
(2) php says:

Hi Justin -

Try this: mysqlimport -u user_name -p your_password database_name file_name.sql

Angela

July 11, 2009 at 6:49 am
(3) Sunil says:

Hi Angela, i have my backup file in different directory, How do i specify the path of that dir. can u plz help..
– Thanks in Advance.

Leave a Comment

Line and paragraph breaks are automatic. Some HTML allowed: <a href="" title="">, <b>, <i>, <strike>

Explore PHP / MySQL
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. PHP / MySQL

©2009 About.com, a part of The New York Times Company.

All rights reserved.