<i id='nLqhX'><tr id='nLqhX'><dt id='nLqhX'><q id='nLqhX'><span id='nLqhX'><b id='nLqhX'><form id='nLqhX'><ins id='nLqhX'></ins><ul id='nLqhX'></ul><sub id='nLqhX'></sub></form><legend id='nLqhX'></legend><bdo id='nLqhX'><pre id='nLqhX'><center id='nLqhX'></center></pre></bdo></b><th id='nLqhX'></th></span></q></dt></tr></i><div id='nLqhX'><tfoot id='nLqhX'></tfoot><dl id='nLqhX'><fieldset id='nLqhX'></fieldset></dl></div>
  • <small id='nLqhX'></small><noframes id='nLqhX'>

    <tfoot id='nLqhX'></tfoot>
      • <bdo id='nLqhX'></bdo><ul id='nLqhX'></ul>
      <legend id='nLqhX'><style id='nLqhX'><dir id='nLqhX'><q id='nLqhX'></q></dir></style></legend>

        如何将本地 MySQL 数据库部署到 Heroku

        时间:2023-06-26
          <bdo id='xMghP'></bdo><ul id='xMghP'></ul>
            1. <i id='xMghP'><tr id='xMghP'><dt id='xMghP'><q id='xMghP'><span id='xMghP'><b id='xMghP'><form id='xMghP'><ins id='xMghP'></ins><ul id='xMghP'></ul><sub id='xMghP'></sub></form><legend id='xMghP'></legend><bdo id='xMghP'><pre id='xMghP'><center id='xMghP'></center></pre></bdo></b><th id='xMghP'></th></span></q></dt></tr></i><div id='xMghP'><tfoot id='xMghP'></tfoot><dl id='xMghP'><fieldset id='xMghP'></fieldset></dl></div>
                <tbody id='xMghP'></tbody>
              <legend id='xMghP'><style id='xMghP'><dir id='xMghP'><q id='xMghP'></q></dir></style></legend>

                <tfoot id='xMghP'></tfoot>

                1. <small id='xMghP'></small><noframes id='xMghP'>

                  本文介绍了如何将本地 MySQL 数据库部署到 Heroku的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我是 Heroku 的新手,我有一个 Ruby/Sinatra 应用程序,我计划在其中使用 MySQL 数据库作为主要数据存储.

                  但是,我不想将结果直接写入 Heroku 上的数据库.相反,我想将结果写入本地数据库,然后能够轻松地将我的本地数据库部署/更新/复制到 Heroku 上的生产"数据库.

                  我该怎么做?

                  谢谢.

                  解决方案

                  首先 Heroku 原生使用 postgres.如果您在本地使用它,您的生活会更轻松.

                  您可以按照此处所述从 heroku 导入/导出 postgres 转储文件:https://devcenter.heroku.com/articles/heroku-postgres-import-export

                  如果你真的想用mysql,你有两条路可以走.

                  1) 在本地运行 mysql,但在使用 mysql2psql gem 迁移到 Heroku 时转换为 postgres,如下所述:https://devcenter.heroku.com/articles/heroku-mysql

                  2) 使用像 https://addons.heroku.com/cleardb 的 mysql 插件>

                  不过,我的建议是端到端使用 postgres,因为它已融入 Heroku,并且您将使用 Heroku 的默认使用方式,而不是反对它们.

                  Postgres 也很好!

                  I'm new to using Heroku and I have a Ruby/Sinatra app in which I plan on using a MySQL database as the main data store.

                  However, I do not want to write results directly to the database on Heroku. Instead, I want to write the results to a local database, and then be able to easily deploy/update/copy my local DB to the "production" database on Heroku.

                  How do I do this?

                  Thanks.

                  解决方案

                  Firstly Heroku natively uses postgres. Life will be easier for you if you use that locally.

                  You can import / export postgres dump files from heroku as described here: https://devcenter.heroku.com/articles/heroku-postgres-import-export

                  If you really want to use mysql, you have two paths to follow.

                  1) Run mysql locally, but convert to postgres when migrating to Heroku using the mysql2psql gem, as described here: https://devcenter.heroku.com/articles/heroku-mysql

                  2) Use a mysql addon like https://addons.heroku.com/cleardb

                  However my recommendation would be to use postgres end to end, as it is baked into Heroku, and you'll be working with the default ways of using Heroku, not against them.

                  Postgres is very good too!

                  这篇关于如何将本地 MySQL 数据库部署到 Heroku的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:打印 MySQLdb 运行的实际查询? 下一篇:MySQL - 替换列中的字符

                  相关文章

                  <i id='pl65L'><tr id='pl65L'><dt id='pl65L'><q id='pl65L'><span id='pl65L'><b id='pl65L'><form id='pl65L'><ins id='pl65L'></ins><ul id='pl65L'></ul><sub id='pl65L'></sub></form><legend id='pl65L'></legend><bdo id='pl65L'><pre id='pl65L'><center id='pl65L'></center></pre></bdo></b><th id='pl65L'></th></span></q></dt></tr></i><div id='pl65L'><tfoot id='pl65L'></tfoot><dl id='pl65L'><fieldset id='pl65L'></fieldset></dl></div>

                    1. <legend id='pl65L'><style id='pl65L'><dir id='pl65L'><q id='pl65L'></q></dir></style></legend>
                      • <bdo id='pl65L'></bdo><ul id='pl65L'></ul>

                      <small id='pl65L'></small><noframes id='pl65L'>

                      <tfoot id='pl65L'></tfoot>