Suddenly got
SQLSTATE[HY000]: General error: 1835 Malformed communication packet (SQL: select * from tb_users where (username =
tb_users
username
What worked for me was to upgrade PHP version on the subdomain from 7.2 to 7.3. I did not change anything in the database configuration as has been suggested in some answers.