You cannot copy a database because, once the database is damaged, copying its files is useless !! The following describes how to back up and restore a database using the doscommand:
1. mysqldump backup:
Create a new blank table = clear table = initialization note case sensitivity: mysql> show databases; // The command words are generally uppercase!
1 = backup database structure = C: \ Documents ents and Settings \ user> mysqldump-u root-proot-d -- opt new_db> c: \ 3456. SQL // empty table without data
2 = enter MySql = C: \ Documents ents and Settings \ user> mysql-u root-proot
3 = delete DATABASE = mysql> drop database new_db;
4 = CREATE a DATABASE = mysql> create database new_db;
5 = use Database = mysql> use new_db
6 = import SQL file = mysql> source c: \ 3456. SQL
Ii. data recovery:
1 = backup database and data = C: \ Documents ents and Settings \ user> mysqldump-u root-proot -- opt new_db> c: \ an. SQL // do not wait for a semicolon
2 = enter MySql = C: \ Documents ents and Settings \ user> mysql-u root-proot
// Mysql> show databases;
3 = delete database = mysql> drop database new_db;
4 = create a database = mysql> create database new_db;
5 = use Database = mysql> use new_db
6 = import SQL file = mysql> source c: \ 3456. SQL