将 MySQL 数据库复制到另一台机器 [英] Copying MySQL Database to another machine

查看:38
本文介绍了将 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

如果有错请指正

这篇关于将 MySQL 数据库复制到另一台机器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆