How to pass application user names to the database server for audit purposes?
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