Experimental eleven MySQLl backup and recovery 1

Experimental eleven MySQL backup and recovery

First, the  Experiment:

1, using the SQL statement to import and export data tables

2, using the client database backup and restore tool

3, using the log file to restore the database

Second, the  pilot project: student achievement database

Create a database for student performance management, database called XSCJ in, XSCJ database consists of three tables: xs (students basic information table), kc (course information table), xs_cj (transcript). .

Third, the  experimental procedures require the use statement completion :()

1 using select into ...... outfile xs export table data, export file name xs.txt, requires each end of line breaks rows;

 

 

2, using the create table like the same statement creates a table structure xs xs1 table, and use the load data to the data integrity xs.txt xs1 import table, and the table view xs1;

 

 

3, using the select into ...... outfile kc export table data, export file name kc1.txt, required fields separated by commas, character field value in double quotes, each rows with "->" at the beginning, end of each line carriage return line;

 

 

4, create a table structure identical kc create table like Table kc1 use statement, using load data to import data kc1.txt kc1 table, it is required to import data is ignored preceding three records, only introduction course name, course number credits three columns of data;

 

 

5, the backup using mysqldump xs xscj database table to a file in xs2.sql;

 

 

6, using mysqldump to back up the database to a file xscj1.sql in xscj

 

 

7, xscj database backup using mysqldump and mysql database to a file twodatabase.sql in;

 

 

8, all mysqldump database backup files to MySQL server all.sql in;

 

 

9、   删除xs表,使用mysql命令将文件xs2.sql中的数据恢复到xscj数据库中

 

 

10、            删除xscj数据库中的所有表,使用mysql命令将文件xscj1.sql中的数据恢复到xscj数据库中;

 

 

11、            将xs表中的数据清空,使用mysqlimport命令将xs.txt中的数据导入到xs表中。

 

 

四、  实验报告要求

1、 实验报告格式要求

包括内容:标题、实验内容、实验步骤、实验中遇到的问题及解决方案

2、 实验报告内容要求

(1)     标题参看实验指导标题+“实验报告”,如“实验一 MySQL的安装与命令初步实验报告”;

(2)     实验内容与实验指导中相同;

(3)     实验步骤中将自己实验中的每个步骤的命令和操作结果显示界面进行截图完善。

(4)     实验中遇到的问题及解决方案中如实地将自己的问题的解决过程记录出来。

3、 实验报告提交要求

每次实验课结束之后,每个人需要提交实验报告,实验报告命名为:学号姓名 

五、  补充说明

 

Guess you like

Origin www.cnblogs.com/lvwuwa/p/11128504.html
Recommended