How to create a python code and connect it to Mysql

Asked

Viewed 725 times

-3

Eae Galera, I’m learning the database language, but I still don’t know everything to the letter so I came here to ask you for help to know how I can do this. I know there is sqlite3 in python but I want to use mysql, in which case I have Workbench on my linux. So I want to type Create a code in Python in which the user runs the program and enters and registers the employees of the company there this program saves in a database (is it possible to put the database as if it were online then the program connects to the bank and is saving ?) there every time he enters it picks up and asks for the password, so far so well I already know how to do, but my problem is how I create the database in Workbench and then connect it in Python and then enter into the data. Another point also that I am in doubt is type if I have how to put the database online as I will connect the application in it and as I make changes in it kind see who registered, add new tables, delete row and etc... Help me so I’m new at this I need tips and help please.

1 answer

1

There are several ways to do this, without knowing its context it is difficult to give an accurate answer. Will you use some framework to put the "app" on the air? Do you have any legacy database or will you start "from Scrap"? in both cases you can use the Flask or the Django, both use the database mapping strategy (ORM), flask uses the sqlalchemy, that Voce can use even if you don’t use flask, Django already uses its own ORM.

If you are not going to use any framework, and will develop with "pure" python, then surely my suggestion is sqlalchemy.

  • The only problem with Django is that I have no idea where to go

  • But with Django I could make a complete program in python and then use it to connect the program in the online database ?

  • dango is a framework all done in python, ie, is a set of python software pieces that 'does' for Voce what you would take months to do alone. Yes you can connect most banks, but one of the coolest things on Jango is to let you manage the bank, so you would define the structure of it through Jango itself. For starters I already gave you the tip from the site, do this full tutorial.

  • but is there any way I can do the program there I do the database (program totally in pure python) then I host the database leaving it online and make a connection between the program and the database ? if you can explain to me how ?

  • Ahahaha, you want me to do it for Voce? Do some research.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.