Error in Database Setting
Title
Question
For database setting I got following error.
Error: Database connection failed
It is possible that the database is overloaded or otherwise not running properly.
The site administrator should also check that the database details have been correctly specified in config.php
Warning: mysqli::__construct(): (HY000/1045): Access denied for user 'moodle'@'localhost' (using password: YES) in /var/www/html/moodle/lib/dml/mysqli_native_moodle_database.php on line 79
Moodle-Learning-Management-System Course-Administration-in-Moodle 11-12 min 30-40 sec
Answers:
You have done this, right?
GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,CREATE TEMPORARY TABLES,DROP,INDEX,ALTER ON moodle.* TO moodle@localhost IDENTIFIED BY 'yourpassword';
Also, some helpful links:
1. https://docs.moodle.org/38/en/MySQL#Creating_Moodle_database
2. https://moodle.org/mod/forum/discuss.php?d=340330
Do you correctly remember the password?
If not, then try logging into mysql as a 'root' user and then either you can reset the password for the user 'moodle' and retry granting proper permissions to user 'moodle'.
You can run the command "CREATE DATABASE moodle DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;" only after logging into mysql.
Also, are you using phpmyadmin? If not, they you can try that, it has an easy to use interface.
Try this:
sudo mysql -u moodle -p
and then enter your password for user 'moodle', provided you have already created user 'moodle'.
I have forgotten the admin password
please tell me, how to reset password?
Login to add comment
For changing mysql 'root' user password, please check out these links-
- https://support.rackspace.com/how-to/mysql-resetting-a-lost-mysql-root-password/
- https://websiteforstudents.com/resetting-mysql-root-password-on-ubuntu-16-04-17-10-and-18-04-lts/
Can I run this command on the terminal?
please tell me, how to reset password?
Login to add comment