Command line restore DB Mysql

I need replace Database on my installation MYSQL.

– Connect to DB

mysql -u <username> -p

– Show DB

SHOW DATABASES;

+——————–+
| Database           |
+——————–+
| information_schema |
| mysql              |
| website            |
| wp-test            |
| wpdb               |
+——————–+
5 rows in set (0.00 sec)

– Drop Database

 DROP DATABASE wpdb;
Query OK, 18 rows affected (0.01 sec)

-Recreate DB

 create database wpdb;
Query OK, 1 row affected (0.00 sec)

– Import Database

mysql -u user -p wpdb < wp_xxxx2014.dmp

Command line restore DB Mysql

Leave a Reply

Your email address will not be published.