1044 - 访问被拒绝用户'用户'@'localhost'到数据库'db' [英] 1044 - Access denied for user 'user'@'localhost' to database 'db'

查看:1201
本文介绍了1044 - 访问被拒绝用户'用户'@'localhost'到数据库'db'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试了很多,导入sql脚本通过phpmyadmin在我托管的新网站创建数据库和表。但是我得到的错误,


1044 - 访问拒绝用户'用户'@'localhost'到数据库'db' p>

我试图直接创建一个示例数据库:create database sampled;我收到的访问被拒绝错误。



我也无法向用户授予权限,我获得相同的拒绝访问错误。 p>

以下是show grants命令的输出,

  show grants; 
授予使用权。 TO'someuser'@'localhost'IDENTIFIED BY PASSWORD'somepw'

授予所有特权在某人user\ _%。* TO'someuser'@'localhost'

任何帮助将不胜感激。

解决方案

如果您使用Godaddy,请不要直接转到phpMyAdmin并运行



您必须转到MySQL®数据库部分并在其中创建数据库。
然后创建用户,并向其授予权限以访问刚刚创建的数据库。
现在您可以转到 phpMyAdmin 并编写您的SQL命令。



希望这有助于


I tried a lot to import the sql script to create database and tables through phpmyadmin in the new site I hosted. But i'm getting the error,

1044 - Access denied for user 'user'@'localhost' to database 'db'

I tried to create a sample db directly : create database sampled; I'm getting the same access denied error.

I'm not able to grant privileges to the user also, i'm getting the same access denied error.

Following is the output of show grants command,

show grants;
GRANT USAGE ON . TO 'someuser'@'localhost' IDENTIFIED BY PASSWORD 'somepw' 

GRANT ALL PRIVILEGES ON someuser\_%.* TO 'someuser'@'localhost' 

Any help would be appreciated. thank you.

解决方案

If you are using Godaddy then don't directly go to phpMyAdmin and run the sql command.

You have to go to MySQL® Databases section and create a database there. Then create a user and give it the permission to access the database you just created. Now you can go to phpMyAdmin and write your SQL commands.

Hope this helps

这篇关于1044 - 访问被拒绝用户'用户'@'localhost'到数据库'db'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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