导出本机数据库
mysqldump -uroot -proot medical_business_data_myisam > /opt/data_backup/171/medical_business_data_myisam.sql;
ps: mysqldump 这个是mysql命令;-u账号 -p密码 ;medical_business_data_myisam数据库名称 ;/opt/data_backup/171/medical_business_data_myisam.sql备份的地址及文件
远程导出数据库
mysqldump -h 192.6.3.1 -uroot -proot operating_library_data > /opt/data_backup/111/operating_library_data.sql;
导入数据库
先删除数据库
drop database operating_library_data;
创建数据库
create database `operating_library_data` character set utf8 collate utf8_general_ci;
进入需要导入的数据库,导入
source /opt/data_backup/111/operating_library_data.sql;
来源:CSDN
作者:MR_WANG0312
链接:https://blog.csdn.net/MR_WANG0312/article/details/103830795