![]() ![]() This article will work for any Linux distribution running MySQL.ġ. sql file of an existing database, which can then be restored to any other empty MySQL database. In this tutorial, you have learned step by step how to copy a MySQL database on the same server and copy database from a server to another.How to backup and restore MySQL databases on LinuxĪ simple and easy method for creating MySQL backups is to use the mysqldump command. >mysql -u root -p classicmodels < c:\tmp\db.sql ![]() Third, import the db.sql file to the database server with the assumption that the db.sql file was copied to c:\tmp\ folder. In short, the following statements are included at the beginning of the SQL dump file when we use -database option. These statements will create the classicmodels database in the destination server and make the new database as the default database for loading the data. Note that -database option allows mysqldump to include both CREATE DATABASE and USE statements in the SQL dump file. >mysqldump -u root -p -databases classicmodels > d:\db\db.sql Let’s take a look at how to copy the classicmodels database from a server to another.įirst, export the classicmodels database to db.sql file.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |