I just had the same issue. I figured my database user didnt have privilage to access the database. I have set the permissions for the database user in PHP myadmin to “all” and it solved it.
Based on your description you seem to miss this part, too, because just creating the user and the db won’t be enough, you’ll need to give access to the db for the user. Hope this helped.