Just to confirm:
1). You've set up a database for WordPress on MySQL with a user and password (if the user and password wasn't already configured by your host).
2). You've opened up the wp-config-sample.php file in a text editor, and inserted the correct information (database name, user account for that database, and user password) and saved this edited file as wp-config.php. And then uploaded it to your server in the folder containing your WordPress files
If, despite the above steps, you still get a database connection error, contact your host and see if there's something else that might impact connecting to the database (firewalls, reverse proxies, closed ports, etc.)