Technipelago AB

Technipelago Blog Stuff that we learned...


How to copy a MySQL database

Publicerad den 10 dec 2009

How to copy a MySQL database with mysqldump

This is how I copy databases.


# Export
mysqldump --opt --skip-add-drop-table
  -h localhost -u root -p
    database > database.sql

# Import
mysql -u root -p
drop database dbname;
create database dbname;
use dbname;
source database.sql

Tags: mysql


« Tillbaka