Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database #3

Open
WanderingCoder-Omen opened this issue Jan 27, 2020 · 1 comment
Open

Database #3

WanderingCoder-Omen opened this issue Jan 27, 2020 · 1 comment

Comments

@WanderingCoder-Omen
Copy link

Hi I believe you're using a MySQL db in this example. Can you please tell us how to setup the database ?

@plusangel
Copy link

Let's assume that you use Ubuntu 18.

First, you need to install MySQL. Please follow that tutorial "How To Install MySQL on Ubuntu 18.04", it's very decent.

Then you need to connect to MySQL using a command like (assuming that you have adjusted User Authentication and Privileges):

and create the new empty database like that:
mysql -u username -p

Then install PyMySQL using pip.
CREATE DATABASE dbname;

Then it's time to set the connection string for flask-SQLAlchemy in the .env file that will look like:
SQLALCHEMY_DATABASE_URI=mysql+pymysql://root:password@localhost/db_users

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants