Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
465 views
in Technique[技术] by (71.8m points)

python - 如何将本地mysql数据库上传到heroku应用程序?(How to upload local mysql database to heroku app?)

I have a web application written in Python-Flask with database created using MySQL.

(我有一个使用Python-Flask编写的Web应用程序,并使用MySQL创建了数据库。)

I have deployed my app using Heroku but it's only the frontend and backend part.

(我已经使用Heroku部署了我的应用程序,但这只是前端和后端部分。)

I also need to upload database so that the app can interact with the database.

(我还需要上传数据库,以便应用程序可以与数据库进行交互。)

I have searched many videos on YouTube but nothing came as useful.

(我在YouTube上搜索了许多视频,但没有什么有用的。)

Most of them are using Postgre SQL both in local and heroku app but I've an MySQL database with me.

(他们中的大多数人都在本地和heroku应用程序中都使用Postgre SQL,但是我有一个MySQL数据库。)

I need help how can I connect my app to my database.

(我需要帮助,如何将我的应用程序连接到数据库。)

  ask by Barefaced Bear translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Heroku has native support for postgessql not mysql, so you might want to change to that or use the Clear DB addon as explained in the docs.

(Heroku对postgessql而非mysql具有本机支持,因此您可能想要更改为该版本,或按照文档中的说明使用Clear DB插件 。)

From heroku

(从heroku)

"Heroku provides three managed data services to all customers:

(“ Heroku为所有客户提供三种托管数据服务:)

Heroku Postgres, Heroku Redis, Apache Kafka on Heroku"

(Heroku Postgres,Heroku Redis,Heroku上的Apache Kafka”)

Also have a look at this previous answer that targets the same issue.

(也可以看看针对相同问题的先前答案 。)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...