Blog Bustle 20/02/2020
We can copy mysql database to another database which is on same server or another server. It is easy and fast process.
Lets know what are the steps of mysql copy database to another database
Step 1: Take backup of database whom do you want to copy
Step 2: Create new database in which you want to copy
Step 3: Import backup file into new database
for example, we have student database and we want to copy student database into college database. so first we take backup of student database. We know, we use mysql dump tool for database backup.
mysqldump -u [user_name] -p [user_password] [database_name] > [dump_file_name.sql]
I am using local server, so database backup command will be
mysqldump -u root -p student > d:\student.sql
in my case username is root and password is empty.
create database database_name;
now i am going to create college database in mysql server and command line will be
create database college;
so our new database is ready and we have taken backup of student database and it's time to import student.sql file into college database.
mysql -u [user_name] -p [user_password] [database_name] < [dump_file_name.sql]
We will import student.sql file into college database and import database mysql command line will be
mysql -u root -p college < d:\student.sql
So we saw mysql copy database is easy, simple and fast process.
Mysql copy database is very useful when we are working on any project and continue we are doing some changes in current database so we have to keep database backup. We also use this database backup for local server testing.
Sql Insert Query
Sql Update Query
Sql & Mysql difference
Sql Delete Query
Sql Select Query
Mysql no database selected error 1046
Sql Create Table
Sql Drop Table
Sql Alter Query(add, drop, modify & change column)
Sql Truncate Table
Sql Insert Into Query
Sql Rename Table
Sql DISTINCT Keyword
Sql WHERE Clause
Sql Like operator
Sql AND operator
Sql OR operator
Sql NOT operator
Combining Sql AND, OR & NOT operator
Sql IN operator
Sql NOT IN operator
Sql Count, Sum, Avg, Min, Max
Sql Order By clause
Sql Limit clause
Sql BETWEEN operator
Sql Group By clause
Sql Aliases
Sql Inner Join
Sql Left Join
Sql Right Join
Mysql Create Database
Mysql Create Database Command Line
Mysql Delete Database
Mysql Delete Database Command Line
Mysql Show Databases
Mysql Show Databases Command Line
Mysql Select Database
Mysql Select Database Command Line
Mysql Backup Database
Mysql Import Database
Mysql Copy Database
Mysql Rename Database
Truncate Database Mysql