问题描述
如果没有对服务器的本地访问,有没有办法在不使用 mysqldump 的情况下将 MySQL 数据库(有内容和没有内容)复制/克隆到另一个数据库中?
Without local access to the server, is there any way to duplicate/clone a MySQL db (with content and without content) into another without using mysqldump?
我目前使用的是 MySQL 4.0.
I am currently using MySQL 4.0.
推荐答案
我看到你说你不想使用 mysqldump,但我在寻找类似的解决方案时到达了这个页面,其他人也可能会发现它.考虑到这一点,这里有一种从 Windows 服务器的命令行复制数据库的简单方法:
I can see you said you didn't want to use mysqldump, but I reached this page while looking for a similar solution and others might find it as well. With that in mind, here is a simple way to duplicate a database from the command line of a windows server:
- 使用 MySQLAdmin 或您的首选方法创建目标数据库.在本例中,
db2是目标数据库,源数据库db1将被复制到其中. - 在命令行上执行以下语句:
- Create the target database using MySQLAdmin or your preferred method. In this example,
db2is the target database, where the source databasedb1will be copied. - Execute the following statement on a command line:
mysqldump -h [服务器] -u [用户] -p[密码] db1 |mysql -h [服务器] -u [用户] -p[密码] db2
注意:-p 和 [password]
这篇关于不使用 mysqldump 复制/复制数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!


大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)