试图迁移本地MySQL服务器到AWS

编程入门 行业动态 更新时间:2024-10-25 15:32:31
本文介绍了试图迁移本地MySQL服务器到AWS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

请就如何我的本地MySQL服务器迁移到云中。

目前我有Fedora Linux中和NAS通过以太网连接到它。 我相信,去了解它最好的办法是:

  • 在采取所有数据库的mysqldump的
  • 创建一个Amazon RDS实例,并尝试从创建的mysqldump加载
  • 转移到该实例本地连接
  • 我是在正确的轨道? 我应该如何去这样做(1)。我到MySQL服务器的用户名和密码的访问,它只有1个数据库。我试图按照网上一些联系,但该命令似乎没有工作。

    时(2)甚至可能吗?

    最终目标是从本地服务器连接到数据库服务器上的AWS,并能够无缝地查询。

    解决方案

    我已经做了类似的迁移,我认为你是在正确的轨道。

      

    我应该如何去这样做(1)?

    只要看看你的数据库的mysqldump和其存储在一个文件中,例如:

    的mysqldump -h [主持人] -u [用户] -p [密码] [DBNAME] GT; dumpfilename.sql

      

    是(2)甚至可能吗?

    当然可以。您可以连接到MySQL的RDS实例,就像你连接到任何其他MySQL实例。主机名refered为在AWS管理控制台终点。

    您已经创建了RDS实例,并设置安全组的一个,你就可以加载转储:

    的mysql -h [终点] -u [用户] -p [密码] [DBNAME] LT; dumpfilename.sql

    Please advise on how to migrate my local mysql server to the cloud.

    Currently I have a Fedora linux box and a NAS attached to it via ethernet. I believe the best way to go about it is :

  • Take a mysqldump of all databases
  • Create an amazon RDS instance and try to load from the created mysqldump
  • Shift local connection to this instance
  • Am I on the right track ? How should I go about doing (1). I have a username and password based access to the mysql server and it has only 1 database. I tried to follow a few links on the net but the commands did not seem to work.

    Is (2) even possible ?

    The end goal is to connect from local servers to DB server on AWS and be able to query seamlessly.

    解决方案

    I've done similar migrations and I think you're on the right track.

    "How should I go about doing (1)?"

    Just take a mysqldump of your DB and store it in a file, e.g.:

    mysqldump -h [host] -u [user] -p[password] [dbname] > dumpfilename.sql

    "Is (2) even possible ?"

    Absolutely. You can connect to a MySQL RDS instance just like you would connect to any other MySQL instance. The host name is refered to as "endpoint" in the AWS Management Console.

    One you've created the RDS instance and setup the security group, you're ready to load the dump:

    mysql -h [endpoint] -u [user] -p[password] [dbname] < dumpfilename.sql

    更多推荐

    试图迁移本地MySQL服务器到AWS

    本文发布于:2023-11-28 12:55:51,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1642491.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:服务器   MySQL   AWS

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!