How to take Mysql database backup and restore

on July 28 | in LAMP | by | with No Comments

 

With Below command you can take mysql database backup.

 

mysqldump -u root -p userdb > userdb.sql



With Below commands you can restore mysql database sql file to some other server.

Login to that target server and then login with mysql credentials and create a new database where you will import your userdb.sql file

 

mysql -u username -p
create database new_db;
exit

mysql -u root -p new_db < userdb.sql
1774 Total Views 1 Views Today
Pin It

related posts

Comments are closed.

« »