Hello,
I created my first web app using the 1-click web app. I am using Flask and SQLAlchemy. Right now my db is the SQLite file. The problem I am having is, that user can write to the db via the website, but I have no way of accessing /managing this data. So I want to move to a managed MySQL database.
Has someone done something like this before, could help me or send me in the right direction.
Any help greatly appreciated!
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hi there,
Yes, I believe that this should be doable. You can start by first exporting your SQLite data to a SQL file using the
sqlite3
CLI:Then once you have your data, you can convert SQLite SQL to MySQL compatible SQL: There are some differences in SQL syntax between SQLite and MySQL. You can use this Python package here for example:
To install the package run:
Then, run the conversion:
Finally, you can import the converted file to your MySQL database using the
mysql
CLI client as described in the docs here:https://docs.digitalocean.com/products/databases/mysql/how-to/import-databases/
Let me know if you hit any problems!
Best,
Bobby