Problem with database connection after restoration

Nextcloud version (eg, 18.0.2): 19
Operating system and version (eg, Ubuntu 20.04): Debian 10
Apache or nginx version (eg, Apache 2.4.25): Nexinx 1.14.2
PHP version (eg, 7.1): 7.4

Hi I had a problem with the server and I could save the database and nextcloud, but when I install it on the new server I get an error:

Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [1045] Access denied for user 'oc_john'@'localhost' (using password: YES)

I don’t understand why the connection fails

The connection fails because the database server is denying the connection. Make sure that the user “oc_john” is allowed to connect to the database on the localhost network interface and that you grant access rights to the Nextcloud database.

Yes, “oc_john” has all privileges for the nextcloud database

Can you please test it:
mysql -u oc_john -p yournextcloudtable

With dbuser and dbpassword from nextcloud/config/config.php