Can you connect to your database from the command line client for mysql:
# mysql -u www-data -p moodle
If not something's wrong with your database setup.
Installing and upgrading help
Cannot connect to database.
This discussion has been locked because a year has elapsed since the last post. Please start a new discussion topic.