It sounds like the user does not have access to connect to the MySQL server where the traffic is originating from.
When you grant permissions say like this:
GRANT type_of_permission ON database_name.* TO ‘osTicketUser’@'localhost’;
You are saying this user osTicketUser, should have type_of_permission on database_name (all tables) FROM localhost. To try to translate this it means only if the user is connecting from the localhost (i.e. the MySQL/MariaDB server). If your webserver and database server are on the server this is fine, if the web server / database server are not on the same server then it won't work. Why? Because you haven't granted the user permission to talk to it.
Fictitious Example
Server A: 192.168.0.10 - running webserver
Server B: 192.168.0.20 - running database
You would grant permission to the user something like this:
GRANT type_of_permission ON database_name.* TO ‘osTicketUser’@'192.168.0.10’;
Make sense?