Access denied for user: 'username@localhost' (Using password: YES)

Access denied for user: 'username@localhost' (Using password: YES)

Sailom V -
回帖数:7

After finished 7 of 10 items of the Installing Moodle, I try to reach my website at httt://127.0.0.1/moodle/admin

The problem is :

Warning: Access denied for user: 'username@localhost' (Using password: YES) in c:easyservwwwmoodlelibadodbdriversadodb-mysql.inc.php on line 175

The database details specified in config.php are not correct, or the database is down.


My System :

Windows XP Professional
FoxServ 3.1 beta 1 installed at C:\EasyServ
Moodle directory is C:\EasyServ\www\doodle

Please help, Thanks

回复Sailom V

Re: Access denied for user: 'username@localhost' (Using password: YES)

Martin Dougiamas -
Core developers的头像 Documentation writers的头像 Moodle HQ的头像 Particularly helpful Moodlers的头像 Plugin developers的头像 Testers的头像
The error message is telling you what is wrong: "The database details specified in config.php are not correct"

I'm guessing that your MySQL username is not actually "username". 微笑
回复Martin Dougiamas

Re: Access denied for user: 'username@localhost' (Using password: YES)

Sailom V -

Many thanks to Martin and John for your suggestions. The problem was solved by changing database setup to

$CFG->dbuser    = "sailomv";   
$CFG->dbpass    = "**********";   .


Other problems are : 


Warning: Failed opening '/theme//header.html' for inclusion (include_path='.;c:\php4\pear') in c:\easyserv\www\moodle\lib\weblib.php on line 625

ERROR: No lang file (/lang/en/moodle.php)!

ERROR: No lang file (/lang/en/moodle.php)!

lang:
 
Warning: OpenDir: Invalid argument (errno 22) in c:\easyserv\www\moodle\lib\moodlelib.php on line 1114

Warning: readdir(): supplied argument is not a valid Directory resource in c:\easyserv\www\moodle\lib\moodlelib.php on line 1115
  ERROR: No lang file 
 
and more ....

This is my "config.php"

$CFG->dbtype    = "mysql";      
$CFG->dbhost    = "localhost";  
$CFG->dbname    = "moodle";     
$CFG->dbuser    = "sailomv";   
$CFG->dbpass    = "**********";   

$CFG->prefix    = "mdl_";       


$CFG->wwwroot   = "http://127.0.0.1/moodle";


$CFG->dirroot   = "";

$CFG->dataroot  = "/moodle/data";

$CFG->buggy_referer = false;


I think there should be something wrong in my config.php that I had to edit "lib/setup.php" before this.

I understood that moodle need to setup only one "config.php" file.
 

回复Sailom V

Re: Access denied for user: 'username@localhost' (Using password: YES)

Martin Dougiamas -
Core developers的头像 Documentation writers的头像 Moodle HQ的头像 Particularly helpful Moodlers的头像 Plugin developers的头像 Testers的头像
There is NO need to edit lib/setup.php

However, you do need to read the directions in config.php a bit more closely than you have been:

$CFG->dirroot = "c:\easyserv\www\moodle";
回复Martin Dougiamas

Re: Access denied for user: 'username@localhost' (Using password: YES)

Sailom V -
Thanks Martin. Your recommendation of dirroot is working.  The new problem is how to connect  to the database.  I has no experience with MySQL (just only know about MS Access) and will spend much times  to study it. 
回复Sailom V

Re: Access denied for user: 'username@localhost' (Using password: YES)

John Davidson -
You need to ensure that the mysql.inc.php file contains the correct MYSQL user details.

You also need to ensure that, when installed, MYSQL is set up witht he same username and password.

Assuming that you've done this, ten it may be an "easyserv" problem - I notice that the pathname you gave has no //slashes//

best wishes

John
回复John Davidson

Re: Access denied for user: 'username@localhost' (Using password: YES)

Martin Dougiamas -
Core developers的头像 Documentation writers的头像 Moodle HQ的头像 Particularly helpful Moodlers的头像 Plugin developers的头像 Testers的头像
I really appreciate everyone who answers questions in this forum (instead of just asking them!) but I do need to correct you in this case, John. 微笑

Firstly, the only file you need to modify is config.php ... the database details are in there.

Secondly, I think the backslashes in the original post were probably stripped automatically by a little PHP bug which I've hopefully just fixed in Moodle.