$CFG->dataroot is not configured properly, directory does not exist or is not accessible! Exiting.

Re: $CFG->dataroot is not configured properly, directory does not exist or is not accessible! Exiting.

by Ken Task -
Number of replies: 2
Picture of Particularly helpful Moodlers

Previously OP shared:

"The versions are shown in cPanel as MySQL 10.0.23-MariaDB and PHP  5.6.17"

So .... ????

'spirit of sharing', Ken



In reply to Ken Task

Re: $CFG->dataroot is not configured properly, directory does not exist or is not accessible! Exiting.

by Adrian O'Sullivan -

Problem solved by the sysadmin. It had nothing to do with Moodle but was a cPanel/SQL problem.

It seems that I had not added the user to the database in cPanel. You have to add the user to the database via the mysql panel in cPanel and give it all privileges. That will then allow the user to connect to the database.

So I'm now connected, and the website is running normally.

Thanks for all the advice. All's well that ends well!

Adrian


In reply to Adrian O'Sullivan

Re: $CFG->dataroot is not configured properly, directory does not exist or is not accessible! Exiting.

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

Adrian, one never know what kind of information will help.  Up above, this was one of my suggestions (i.e., add a user to the database.)  Well, now you know.

In my cPanel, there is an icon to add a mysql database.  Then, after creating a database, you can create and add a user, and finally assign this user to the database.  The is the "user" that gets entered into config.php.   I still go over to phpmyadmin to make sure collation is set for utf8_unicode.  Then I am finished with the database.

When I do my installs from scratch, I never dabble with the config.php file.  During the moodle install, there is a screen that asks for database information (including the user).  If you fill out everything correctly in this dialog box, you won't need to touch config.php.   However, the experience that you gained from all of this will help you be a better moodler.   Good luck.