Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
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

  • Administrator
  • 25,176 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