Thank you for reaching out to us. From the error message it looks like AIP scanner unable to connect to the database.
Wanted to check was this working before ? Did you make any changes to the database with respect to permissions.
Make sure that the service account being used to run scanner processes has required permissions to access the database ?
Execute this command Start-AIPScannerDiagnostics -onbehalf $scanner_account_creds - Use the credentials which were used to setup the AIP scanner initially,
Let me know if you have any questions.
Please remember to "Accept Answer" if answer helped, so that others in the community facing similar issues can easily find the solution.