Kohana 3.1.4:Database_Exception [2]:mysql_connect():访问被拒绝 [英] Kohana 3.1.4: Database_Exception [ 2 ]: mysql_connect(): Access denied

查看:58
本文介绍了Kohana 3.1.4:Database_Exception [2]:mysql_connect():访问被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试浏览 kohana教程

我复制了脚本,但收到以下错误消息:

I have copied the scripts but I getting the following error message:


错误:Database_Exception [2]:mysql_connect():用户'www-data'@'localhost'的访问被拒绝(使用密码:否)〜MODPATH / database / classes / kohana / database / mysql.php [67]

ERROR: Database_Exception [ 2 ]: mysql_connect(): Access denied for user 'www-data'@'localhost' (using password: NO) ~ MODPATH/database/classes/kohana/database/mysql.php [ 67 ]

有人可以给我一些暗示问题可能出在哪里吗?我还有其他使用mysql的项目,所以我知道密码和用户名正确。

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.

推荐答案

如果在您的用户名中更改了用户名config / database.php,错误消息是否更改或保持不变?

If you change the username in your config/database.php, does the error message change or does it stay the same?

如果更改,则说明您对mysql安装的用户权限有问题。如果您有PhpMyAdmin,则很容易修复。转到privleges,单击用户,然后输入%作为允许的主机(或者,如果您偏执,请键入127.0.0.1,以便只能在本地访问它)。

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).

如果不是,那您还没有正确设置database.php,我们需要查看它来纠正它。

If it's not, then you haven't setup database.php correctly and we need to see it to correct it.

这篇关于Kohana 3.1.4:Database_Exception [2]:mysql_connect():访问被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆