将MySQL数据库移至新服务器 [英] Move MySQL database to a new server

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

问题描述

将mysql模式(表,数据,所有内容)从一台服务器移动到另一台服务器的最简单方法是什么?

What's the easiest way to move mysql schemas (tables, data, everything) from one server to another?

是否有一种简单的方法将所有这些操作从一台运行mysql的服务器迁移到另一台已经在运行mysql的服务器?

Is there an easy method move all this from one server running mysql to another also already running mysql?

推荐答案

使用mysqldump或使用PHPMyAdmin转储数据库,然后导出结构和数据.

Dump the Database either using mysqldump or if you are using PHPMyAdmin then Export the structure and data.

对于mysqldump,您将需要控制台并使用以下命令:

For mysqldump you will require the console and use the following command:

mysqldump -u <user> -p -h <host> <dbname> > /path/to/dump.sql

然后在另一台服务器上

mysql -u <user> -p <dbname> < /path/to/dump.sql

这篇关于将MySQL数据库移至新服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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