OK. Here is the process that I use when taking a backup of a customer’s current database and uploading to my own.
First I make a backup of the database using mysqldump.
I go into mysql using my credentials
In this case I am going to take my backup and store it into a new database called openemr2.
I create the database using the command: create database openemr2
I specify with the term “use” so I can set the database I will store the dump to user openemr2
Then I specify the sql file I want to populate the DB with using source 2020_10_13_openemr.sql
If you are trying to upload a copy to a different machine or a different instance, you will want to remove the keys as Steven suggested. If you are on the same instance, you should not have to worry about it.
Now: If you change the database name you will have to update the mysqlconfig file and have it point to that directory. it will be in the var/www/openenmr/sites/default/sqlconfig.php file. In this case I will need to fix the login, pass, and dbase variables (this paricular snapshot is from my repo, not live site)