Very new to Python, but older that I'd care to admit to programming ;-)
So I have been working with SQLAlchemy for the past few days and all has been going well except for one little issue.. When I look at the client connections tab in the MySQL Workbench, the program name is: None.
Anyone know what I need to change so my program name appears in the list?
Thanks.
There needs to be a tutorial on this forum about SqlAlchemy,
completely self contained that starts with data collection, creating a database model, and running a session to load the collected data into that database. You have inspired me to create one, it's started, and will be ready soon. I'll let you know when complete.
It is not a coding issue. As far as I can see it a feature deficit in SQLAlchemy. There just is no way to indicate to MySQL the name of program owning the connection. This becomes a support issue because the DBA has no way of knowing which of the users 5 or 6 connections is related to the user’s application. They all appear in the console with the name ‘None’.
Will eventually have to sit down and figure out a workaround, but for now I will park it. Thanks.
You can use the database itself, by creating a user table and requiring user login for access to the database, Same as you would do for a web application. There's a complete procedure on how to do this in Miguel Grinberg's flask tutorial, which with a few changes can be adapted for both web access and non-web access.
Specifically
chapters 4 and
chapter 5. Would something like liks be sufficient?
SqlAlchemy suggests such a system
here as well (I haven't read this entirely, but enough to see that it involves a user table as well).