Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

What do mysql backup and restore ?



  • This topic is locked This topic is locked

#1
finlaywilson45

finlaywilson45

    New Member

  • Member
  • Pip
  • 1 posts

I am newbie to mysql and want to clarify below on mysql backup and restore

What are the things needed to backup mysql and restore it like database name, username, password etc.

1)I have a database which need to be restored on different server so I used mysql dump command to backup the database by using username root and now during restoration on different server what is the username and password I need to use.

2)If I have created a new empty database on new server so can I restore old database on this new database.


  • 0

Advertisements


#2
azarl

azarl

    GeekU Admin

  • Community Leader
  • 25,310 posts

Step 1:

Back up using mysqldump

 

mysqldump --opt -Q -uUserName -pOldPassword OldDb > OldDb.SQL

 

Where  

UserName = Your User Name on the old database (don't forget the '-u' in front)

OldPassword  = Password on your old database, (don't forget the '-p' in front)

OldDb  = Old Database Name

OldDb.SQL = Backup file to Create

 

Step 2:

Copy the file OldDb.SQL to your new server

 

Step 3:

Create your new database

 

Step 4:

Run this command to populate it:

 

mysql -uNewUserName -pNewPassword NewDb < OldDb.SQL

 

Where  

NewUserName = Your User Name on the NEW database (don't forget the '-u' in front)

NewPassword  = Password on your NEW database, (don't forget the '-p' in front)

NewDb  = NEW Database Name

OldDb.SQL = Backup file Created in step 1

 

 

 


  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP