将 MySQL 数据库复制到另一台机器

2022-01-20 00:00:00 复制 mysql

我在 mt Windows 计算机上有一个 MySQL 数据库.我需要获取一个数据库并将其复制到另一台机器上.另一台机器也运行 Windows 并具有 MySQL 数据库.两台机器无法通过互联网连接.我该怎么办?怎么可以通过USB卡实现呢?

I have a MySQL Database on mt Windows computer. I need to take one database and copy it to another machine. The other machine also runs windows and has MySQL Database. The two machines cannot be connected through internet. What shall I do? How can that be done through USB-card?

推荐答案

在一个sql文件中创建一个导出DB Mysqldump,并将该sql文件复制到USB cardimport它进入另一台机器.按照它可以帮助您实现它的步骤进行操作

Make a export DB Mysqldump in a sql file and copy the sql file to USB card and import it into the other machine.Follow the steps it would help you to achieve it

制作 mysql 转储 以供参考 参见这里示例:

To make mysql dump for reference see here Sample:

mysqldump -u admin -p passwd DB_Name > file/path/filename.sql

import sql 文件到 mysql DB as

样本:

  mysql > use DB_Name;
  mysql >source yourfile.sql

(或)

  mysql -u USERNAME -p PASSWORD DATABASE-NAME < file/path/filename.sql

如果有错请指正

相关文章