问题
I´m trying to walk through a tutorial for kohana
I have copied the scripts but I getting the following error message:
ERROR: Database_Exception [ 2 ]: mysql_connect(): Access denied for user 'www-data'@'localhost' (using password: NO) ~ MODPATH/database/classes/kohana/database/mysql.php [ 67 ]
Could anyone give me some hints to where the problem might lie? I have other projects which use mysql so I know that the password and username are correct.
回答1:
If you change the username in your config/database.php, does the error message change or does it stay the same?
If it changes, then you might have problems with the user permissions on the mysql installation. If you have PhpMyAdmin, it's simple to fix. Goto privleges, click the user and enter % for allowable hosts (or if you're paranoid, type just 127.0.0.1 so you can access it only locally).
If it's not, then you haven't setup database.php correctly and we need to see it to correct it.
来源:https://stackoverflow.com/questions/10483322/kohana-3-1-4-database-exception-2-mysql-connect-access-denied