Error establishing a database connection – Multi-site with subsite don’t exisit [duplicate]

I am not sure if this will help you find your issue, but I believe that you should not have set up your multisite with www

Before_You_Create_A_Network States

While it’s not recommended to use www in your domain URL, if you chose
to do so and plan to use subdomains for multisite, make sure that both
the site address and the WordPress address are the same. Also keep in
mind some hosts will default to showing this sort of URL: nosite.www.example.com