If you are seeing an error connecting to the database or a database connection error in Duplicator, then the most likely reason for this is that you entered incorrect information for your database connection.
Make sure that your database name, MySQL username, and password are correct. Some web hosting companies do not use localhost as the host for their MySQL servers. If this is the case, then you will need to ask your web host’s support staff to provide you with the correct information.