Python Forum

Full Version: SQLAlchemy - Program Name in SQL Workbench
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.
I added a tutorial, but it's pretty basic, and won't answer your question.
To answer your question. It would be most helpful if you could post code (if still dealing with this issue)
See: https://python-forum.io/Thread-SqlAlchem...-Data-Load
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).