SQL格式恢复
先创建表结构
方法一:
[mysql@mysql1 ~]$ mysql -usystem -p123456 -S /data/mysqldata/3306/mysql.sock hugc</data/mysqldata/backup/hugc_fullbak.sql
方法二:
(system@localhost) [(none)]> use hugc;
(system@localhost) [hugc]> source /data/mysqldata/backup/hugc_fullbak.sql;
定界符格式恢复
恢复表结构
[mysql@mysql1 ~]$ mysql -usystem -p123456 -S /data/mysqldata/3306/mysql.sock mysql</data/mysqldata/backup/mysql_test.sql
恢复数据
(system@localhost) [mysql]> load data infile ‘/data/mysqldata/backup/mysql_test.txt’ into table mysql_test fields terminated by ‘,’ enclosed by ‘”’;