With all your pre-requisites done, let’s actually jump right into the code. To install it simply run sudo apt-get install libmysqlclient-dev in your terminal. Note: If you are on a Linux machine, then your need to have libmysqlclient-dev installed before you install mysqlclient. pip3 install Flask Flask-SQLAlchemy mysqlclient To install those, simply run the following command in your terminal. You also need to install flask, flask-sqlalchemy and mysqlclient. In this tutorial, we are currently on the latest python version that is 3.8 ![]() Now let’s actually see how can connect to this database from your flask app. After you have done that, you should see your database listed there. For this tutorial, our database name will be testing. To do that simply, click on the Databases option on the navigation bar at the left and then click on Create database and then provide the name of your database. Now, you first need to create a database. Now, the next page should look something like this. It is always advised to generate the password because it creates a random string and note the password because you can not retrieve it if you forget it and also change the region to your nearest one geographically and then click on create. Now, you should be greeted with the following page. Now, click on CREATE INSTANCE and then for this tutorial we would be selecting the MySQL option.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |