将MySQL数据库复制到另一台机器 [英] Copying MySQL Database to another machine
问题描述
我在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屋!