Mysql数据库连接错误
每当我尝试通过 php 脚本连接 phpMyadmin 时,它都会显示一些错误,例如 警告:mysql_connect(): 用户 'www-data'@'localhost' 的访问被拒绝(使用密码:NO)
I我使用的是 ubuntu 11.04。那么你能告诉我如何解决这个问题吗?
whenever I am trying to connect phpMyadmin through php script it is showing some errors like this Warning: mysql_connect(): Access denied for user 'www-data'@'localhost' (using password: NO)
I am using ubuntu 11.04.So can you tell me how to solve this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
此错误仅意味着您的连接信息不正确。您正在尝试使用用户名“www-data@localhost”(不带密码)连接到 MySQL 数据库。检查您的 MySQL 权限以了解您需要执行的操作。该登录名需要密码,或者未指定该登录名有权访问数据。
要检查您对该用户拥有哪些权限,请运行此 MySQL 脚本:
要向该用户添加权限(如果缺少),请运行此脚本:
This error simply means that your connection information is incorrect. You are trying to connect to the MySQL database using the username "www-data@localhost" with no password. Check your MySQL permissions to see what you need to do. Either this login needs a password or this login is not specified as being permitted to access the data.
To check what permissions you have for that user, run this MySQL script:
To add rights to that user (if they are missing), run this script:
这对我有用。
This works for me.