User Profile Synchronization: An error has occurred while accessing the SQL Server database or the SharePoint Server Search service
To resolve this error follow these resolution tips:
1. On central admin, go to manage services on server, start and stop the user profile service and user profile synchronization service. This will re-provision the UPS
2. If you havent reset IIS after configuration via AutoSPInstaller, try iisreset and see if that fixes the issue
3. On the Central Administration Home page, click Security, and then click Service Applications.
On the Security page, in the General Security section, click Configure service accounts.
On the Service Accounts page, in the service account drop-down list, click Farm Account.
Verify that this account has sufficient permissions on the database server.
The database to check for permission are <Prefix>Profile<Suffix>
Hope this helps