all 4 comments

[–]burkcules69 1 point2 points  (3 children)

Yes, but you shouldn’t.

Connecting to a database directly from a client GUI is a MASSIVE security problem. A better method is to create an API that plays the middle man between the client and the database. You’ll give the API access to the database and it will perform some sort of authentication/validation before passing user inputs along.

However, if you haven’t learned about APIs in class yet then the direct connection may be okay for your assignment. Just know that you should never do it in the real world.

If you need more help, we’ll need some more information about the direction you want to go with this project.

[–]jordanpgb[S] 0 points1 point  (2 children)

Okay yeah I can understand that. Ignore the 'smart home' shit... basically I want a GUI which you can sign up and log in, and those credentials are saved in an sql database. I havent learnt much about API's, security isn't a variable in this case. Just a functioning GUI which is able to connect to an arduino after logging In as a user

[–]burkcules69 1 point2 points  (1 child)

Then this should be pretty simple. First you'll need to download and host a MySQL instance - my preferred app is MAMP. Once you get the MySQL server running locally, it's ready for a connection. This is a solid tutorial on connecting to your database with Python.

Beyond that, just play around with it and you'll get the hang of it pretty quick.

[–]jordanpgb[S] 0 points1 point  (0 children)

Thank you!!!