This problem may arise when server was recovered after some hard disk crashing as during this restoration process, the original password may be cleared / blanked in the database user.
You can login to the CPanel of your website or localhost (if working on local system). Then go to the Database area and click on "MySQL Databases".
Here, you will see all the database users, select your user and set the old password or have a new password and then change it in your opendatabase.php file also.
In some cases , if more databases and multiple users exist then assign specific user to the required database also after setting the password.
Hopefully, it is will you as I got the same problem and solve in the same manner mentioned above.