Replace your Drupal database

It may be useful and fast to replace a Drupal database directly from bash/mysql, with the following commands, where <database> is the name of the database:

  • delete database
    mysql -u ada -pLovelace
    drop database <database>;
    exit
  • create database
    mysql -u ada -pLovelace
    create database <database> character set utf8 collate utf8_general_ci;
    exit
  • import database from ‘Backup and Migrate’ database file
    mysql -u ada -pLovelace -D <database> <database.sql

Leave a Reply

Your email address will not be published. Required fields are marked *