WordPress Error establishing a MySQL database connection IIS10
As commented by @treyBake please see here.
Basically MySQL 8 changed the default charset to utfmb4 and there are now errors with some clients. I downgraded to MySQL Server 5.6 and the problem is gone.