How to pass application user names to the database server for audit purposes? Writing an application that will require a user to login.
I would like to use a table to store my user information; however, the user's ID will not be available to me when I create audits for all my tables.
Conversely, adding the user to the database itself will give me what I need but it's going to be A LOT of users.
What is the best practice here?  I need to be able to create table audits with a column that holds the id of the user that changed it.
If I understand your question correctly, you are asking how to pass an application user name to MySQL to be recorded in an audit table.
You can use a user-defined variable, which is local to the session in which it is created. Your application code will set it to the name of the logged-in user once it is authenticated. Your audit code can then reference that variable and retrieve the user name.
dbfiddle