Issue with SQL: the log for database ‘tempdb’ is not available. Cannot select data for “/username” in sql

When working with AX error looks something like ” cannot select data for “/username” in sql” with select including tempdb.

When logging in into SQL following error appears :

trmpdb error


This issue can be solved by following method:

Check if log files exist using:

use tempdb

If they do exist, then simply restart sql server service, and it should work. Or at least it worked for me