【数据库】Mysql备份文件导入导出

本地导出:
主站导出:mysqldump -u root -p -P 1234 mydatase –default-character-set=utf8 >D:\mydatase.sql
计科系导出:mysqldump -u root -p -P 1234zcibcs –default-character-set=utf8 >D:\zcibcs.sql
           mysqldump -u root -p -P 1234development –default-character-set=utf8 >D:\development.sql
           mysqldump -u root -p -P 1234zcibrecruitment –default-character-set=utf8 >D:\zcibrecruitment.sql
本地导入:
mysql -u root -p -P 1234-f –default-character-set=utf8 mydatase <D:\sqldata\mysql\mydatase__20190103.sql
mysql -u root -p -P 1234-f –default-character-set=utf8 mydatase <E:\backup\websitedata\mysql\mydatase__20200511.sql
mysql -u root -p -P 1234-f –default-character-set=utf8 development <D:\sqldata\mysql\development__20190103.sql
mysql -u root -p -P 1234-f –default-character-set=utf8 zcibcs <D:\sqldata\mysql\zcibcs__20190103.sql
半个小时左右导入成功
远程导出:
主站:
mysqldump -u admin -p -P 1234-h 192.168.1.1 mydatase –default-character-set=utf8 >D:\mydatase.sql
计科系
mysql密码:
!Mysql1qaz2wsx
查看mdf文件的位置
select * from sys.master_files
登陆
mysql -u root -p -P 33306
 show databases
删除数据库
drop database mydatase
创建数据库
CREATE DATABASE IF NOT EXISTSmydatase DEFAULT CHARSET utf8 COLLATE utf8_general_ci;