This bunch of scripts was created to secure MySQL/MariaDB users.
Purporses:
a- password expires > 120d
b- account lock on >3 authentication fails
c- account lock if not logged in for more than 30d
Create admin database, tables and users and define init settings for "a" and "b"
Create Audit Login Trigger for enabling "c"
Procedure that locks user accounts not logged in for more than 30d and displayed in "dbadmin.aud_login", as required in "c"
Extra grants to dbadmin user
Create Event to schedule Lock inactive users and grant audit to users that were created without audit-login. Automate "c".