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.
What do mysql backup and restore ?
Best Answer , --
#1
Posted 22 July 2015 - 10:56 AM
#2
Posted 23 July 2015 - 02:06 AM
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
Similar Topics
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users