Tuesday, March 3, 2015

export import of mysql database on LINUX machine

How to take export of mysql database  on sql file and after this we are going to import this on new database on mysql (installed on linux machine).

take export of database to sql file_name
current path
"/home/singh/"
(you can choose path your own)
mysqldump -u root -p database_name > file_name.sql

import sql dbbackup to database
- create new database
    mysql - u root -p
    - mysql> create database database_name_new;

    - mysql> use database_name_new;
    - mysql> source /home/singh/file_name.sql

No comments:

Post a Comment

web stats