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

查看:239
本文介绍了将MySQL数据库复制到另一台机器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在mt Windows计算机上有一个MySQL数据库。我需要一个数据库,并将其复制到另一台机器。另一台机器也运行windows并有MySQL数据库。
这两台机器不能通过互联网连接。
我该怎么办?

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卡导入到其他机器。按照步骤,它将帮助您实现

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 dump 以供参考 see here
示例:

To make mysql dump for reference see here Sample:

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

import sql 文件替换为 mysql DB

  mysql > use DB_Name;
  mysql >source yourfile.sql

(或)

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

如果错误,请更正我

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

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