Problems installing moodle in web server

Problems installing moodle in web server

by Osmildo Pereira dos Santos -
Number of replies: 5

I am trying to intall moodle 2.4.2 in the web server but this erro message is appearing in database settings: 

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::mysqli(): (28000/1045): Access denied for user 'u557442447_242'@'localhost' (using password: YES) in /home/u557442447/public_html/moodle/lib/dml/mysqli_native_moodle_database.php on line 76

Is there anybody who can help me with this problem?

I'll be waiting...

 

Attachment erro.PNG
Average of ratings: -
In reply to Osmildo Pereira dos Santos

Re: Problems installing moodle in web server

by Richard Jones -
Picture of Plugin developers Picture of Testers

Perhaps we should check the obvious first?

Have you created the moodle database with the username in the error message?

Have you entered the database user and password correctly in your config.php file in the moodle folder?

Have you renamed config-dist to config.php?

HTH

Richard

In reply to Richard Jones

Re: Problems installing moodle in web server

by Osmildo Pereira dos Santos -

Hi, Richard. I am so glad you answered me back. I have no experience in doing that kind of things. So I really would like you to help me doing these things you have mentioned before. For example: 

1 - How can I enter the database user and password in my config.php file?

2 - I am sending a screen shot of my database user.

 

Please, check it out and see what you can do for me. 

Thanks.

Attachment erro2.PNG
Attachment image_04.PNG
In reply to Osmildo Pereira dos Santos

Re: Problems installing moodle in web server

by Richard Jones -
Picture of Plugin developers Picture of Testers

Looks like you have created the database and the user, hopefully you gave this user (u557442447_242a password which you remember also.  You can use the bottom dialog to reset the password for this user (242) if neccessary. 

Now, you have to find the file called config-dist.php in your moodle folder. make a copy of that file called config.php.  Edit config.php and supply the information needed - database type (mysqli), username, password (from the screen above).

$CFG->dbtype = 'mysqli'; // 'pgsql', 'mysqli', 'mssql', 'sqlsrv' or 'oci'
$CFG->dblibrary = 'native'; // 'native' only at the moment  do not change
$CFG->dbhost = 'localhost'; // eg 'localhost' or 'db.isp.com' or IP do not change
$CFG->dbname = 'u557442447_moodle'; // database name, eg moodle 
$CFG->dbuser = 'u557442447_242'; // your database username
$CFG->dbpass = 'password'; // your database user password - 242's password) 
$CFG->prefix = 'mdl_'; // prefix to use for all table names do not change

While you are there, also change the lines

$CFG->wwwroot = 'http://example.com/moodle';  // your website address with /moodle on the end

and

$CFG->dataroot = '/home/example/moodledata';  // probably '/home/u557442447/moodledata'

to the website and location of datafiles on your system.  

You need to create the moodledata folder on your local installation - you can do it at the same level as public_html.  The web root is your public_html folder.  

Be careful with the quotes and the semi-colons.

If these instructions are still not understandable, perhaps consider asking someone local who has some knowledge of websites and databases to help you with it.

Good luck.

Richard

In reply to Osmildo Pereira dos Santos

Re: Problems installing moodle in web server

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

Osmildo, witht he advice that you have received, you might be fine now.  However, if you are still having problems, might I ask you how you have tried installing Moodle?  For example, are you using a one-click install routine from your web hosting company, or are you installing Moodle from scratch yourself?  Also, who might your web hosting company be, and is this a "hosted" server or a VPS?