The error says 'Access denied for user 'moodle-st'@'localhost' (using password: YES)'
A few points to be taken into consideration are:
- Have you entered the password for the database user 'moodle-st' correctly while entering database info during installation?
- And is the user 'moodle-st' granted with the correct permissions for the moodle database?
Solution can be -
You can try creating a new database user and a new db as well.
Commands for Ubuntu OS -
1] Login to mysql as a 'root' user. In terminal type: sudo mysql -u root -p
Enter root password.
2] If not created already, or since you are at an initial phase, you can create database afresh for Moodle:
mysql> CREATE DATABASE moodle DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
3] Create a user/password combination with appropriate permissions for the database:
mysql> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,CREATE TEMPORARY TABLES,DROP,INDEX,ALTER ON moodle.* TO 'moodleuser'@'localhost' IDENTIFIED BY 'yourpassword';
4] Exit from mysql.
Now, continue with Moodle installation and enter the details for database as set above:
Database user: moodleuser
Db password: yourpassword
You need to create a database and a database user first.
- Go to http://localhost/moodle. The language select page should come up and you are away.
- Data directory is C:\moodledata (or whatever you created)
- Database is 'moodle' (name of the database you created)
- Database user is 'root' (unless you created a more restricted user as shown above for your system)
- Database password is whatever you set installing MySQL
Helpful links for Windows OS-
If you are still facing issues after this, please send screenshots of the error if possible.
A few helpful posts from Moodle forums:
You can also check the database details in config.php file (if it has been generated) located at C:\moodle\server\moodle\config.php.
Please let me know if you have any further issues.