saving . . . saved Error in Database Setting has been deleted. Error in Database Setting has been hidden .
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



Please send me proper path.

Moodle-Learning-Management-System Course-Administration-in-Moodle 11-12 min 30-40 sec 13-04-20, midnight prem1914

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
13-04-20, 12:11 a.m. kashmira.n
Sir,


I use  link(https://docs.moodle.org/38/en/MySQL#Creating_Moodle_database) for information and
 use this command on the terminal 'mysql -u moodle -p'
After entering password
I got 'ERROR 1045 (28000): Access denied for user 'moodle'@'localhost' (using password: YES)'

But don't understand.




Can I run this command on the terminal?
.......:/var/log/mysql$ 
<pre>mysql> CREATE DATABASE moodle DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;</pre>


13-04-20, 10:15 p.m. prem1914
I have forgotten the admin password  

please tell me, how to reset password?
16-04-20, 4:38 p.m. prem1914

Login to add comment


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.

14-04-20, 12:48 p.m. kashmira.n
Try this:
sudo mysql -u moodle -p

and then enter your password for user 'moodle', provided you have already created user 'moodle'.
14-04-20, 3:48 p.m. kashmira.n
I have forgotten the admin password  

please tell me, how to reset password?
14-04-20, 9:08 p.m. prem1914

Login to add comment


I have forgotten the admin password  

please tell me, how to reset password?
15-04-20, 3:44 p.m. prem1914


Please mention admin password of what?
16-04-20, 6 p.m. kashmira.n


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/
16-04-20, 6:03 p.m. kashmira.n


Log-in to answer to this question.