How To Use MySQL Database With Flask - Flask Fridays #9

preview_player
Показать описание
In this video I'll show you how to use the MYSQL database with Flask and SQLAlchemy.

In the last video we set up SQLite as the database using SQLAlchemy, in this video I'll show you how to convert that to MYSQL. It's really really easy! None of our actual code will change, we just need to point to a MYSQL database and set it up.

Timecodes
0:00​​ - Introduction
1:27 - Download and Install MySQL
3:44 - Set the DATABASE_URI for MySQL
6:36 - Pip Install MySQL Connectors
7:43 - Create The User Database
12:08 - Try Import Import Database From Python Shell
13:11 - Pip Install PyMySQL and cryptography
13:42 - Update MySQL DATABASE_URI For PyMySQL
14:05 - Import and Create Database From Python Shell
14:28 - Test Out the App
16:58 - Conclusion

#codemy #flask #johnelder
Рекомендации по теме
Комментарии
Автор

▶️ Watch Entire Flask Friday Playlist ✅ Subscribe To My YouTube Channel:
▶️ See More At: ✅ Join My Facebook Group:
▶️ Get The Code

Codemycom
Автор

Your videos are the best, John. One day, I hope this channel will have everything about Python.

sithuhtun
Автор

I subscribed and liked the video just because of the positive energy that you gave me at the beginning of the video 😄. Good Job ! ! !

TarokhYaghoubi
Автор

Great videos John, keep them coming. am really enjoying them and learining alot within a short time. Thanks man! ;)

ajkanya
Автор

Hey John I have a question about working with devise from one of your older videos (I wanted to ask you here bc this is more recent). Do you know how you can enable an admin account to edit all users with devise? I am able to retrieve a list of all users like how you would with any model, but the update action for a user does not work (I think there is no functionality in devise to allow a signed in user to edit another users acc). Do you know the proper way to do this?

yeet-rxiv
Автор

I was able to solve my problem using this video. Thanks a lot.

habtamus
Автор

Do you have any videos for CRUD projects using MySQL+Flask+Python only? I don't believe I'm supposed to use connectors in my class, because we haven't learned about them yet. Awesome video!

kdtallllll
Автор

but what if i have to continue with sql lite like from college project and not for deployment. is All the step you showen is same for SQL lite ?

timjames
Автор

Sqlite is absolutely a production level database! However says otherwise doesn't understand the purpose of it. Sqlite answers the question "how do we increase the speed of the `fopen()` process". In other words, if you are constantly reading data instead of writing or transactioning, Sqlite is the answer. Nevertheless, if you try to use Sqlite as a transactional database then yes of course it's not production level. Right tool for the right job.

toilinginobscurity
Автор

Hi John! Thanks for your videos, question, when I ran the db in a development environment my db works fine, but when I run it with Heroku gave me the [Error 111].

emchivi
Автор

You're flawless at introducing yourself and you've got the motions memorized; including the backwards head thrust of "insanely cheap"! So, my question... now that you've done the same intro soooo many times, do you find yourself doing the introduction at night in your dreams?

strykerk
Автор

Great tutorials! One note, I tried setting this up on AWS, using Postgres…the db.create_all(), required a db.session.commit() to finally work on AWS.

rastaricky
Автор

How can I view the contents of the database? I’m trying to connect to it using a JDBC, but it’s giving me an error saying a certain table does not exist.

silentt
Автор

Thank you for so much value.
Please make video on integrating Django website with Friebase.

subijoyacharya
Автор

Thanks for video, could you please describe how we can use an existing database and make queries on it to show in our flask app? a real DB with multiple columns query with conditions.

behzadbarati
Автор

I think this is a much better hobby for you Mr.White.

--__--
Автор

Enjoyed the video. One of the reasons I like Flasks. Django uses sqlite3 as default, is there a way to change that to MySQL and at the same time using Django ORM.
Thanks in advance

jamikemichelohia
Автор

pip install mysql-connector-python-rf screwed me over. I got an Authentication plugin 'caching_sha2_password' error. I deleted the installs in the venv/lib folder in Pycharm. I then installed pip install mysql-connector, and pip install mysql-connector-python. Everything worked after that.

albertusschrier
Автор

Please what do I choose in the co fig type while installing MYSQL. Development, Server or Dedicated. I want to use it for an actual blog. Thanks.

wordwonders
Автор

How to connect flask to SQLPLUS oracle 10 g???

lavanyau