This is in reference to the following kind of error:

user error: Access denied for user: 'user@host' to database 'database'
query: LOCK TABLES sequences WRITE in [path]/database.mysql.inc on line xx

When you installed Drupal, you created a database and a database user. This error is caused by that database user not having a certain privilege over your database.

When you come across this problem, first, double check that you have granted all privileges to your user. You can try to grant the LOCK tables privilege by executing the following query:

GRANT LOCK TABLES ON databasename.* TO username@localhost IDENTIFIED BY 'password';

If the GRANT command does not seem to have any effect on MySQL, you may need to follow it by "FLUSH PRIVILEGES." If you still get this problem, and you are using shared hosting, it is very likely that your host does not usually let users have the kind of permission required. For reference, you may want to read these forum posts. You need to contact your host (e-mail seems better than live support for this) and ask (if you are using mySQL 4) for global LOCK TABLES privilege for your user in that database.

Although there are fixes in the forums, these are not recommended. If your host denies your request, they may not be an appropriate place for your Drupal site.