1044 - 用户 'user'@'localhost' 对数据库 'db' 的访问被拒绝

1044 - Access denied for user #39;user#39;@#39;localhost#39; to database #39;db#39;(1044 - 用户 user@localhost 对数据库 db 的访问被拒绝)
本文介绍了1044 - 用户 'user'@'localhost' 对数据库 'db' 的访问被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试了很多导入 sql 脚本以通过 phpmyadmin 在我托管的新站点中创建数据库和表.但我收到了错误,

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 - 用户 'user'@'localhost' 对数据库 'db' 的访问被拒绝

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

我尝试直接创建一个示例数据库:create database sampled;我收到了同样的拒绝访问错误.

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.

以下是 show grants 命令的输出,

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.

推荐答案

如果你使用的是 Godaddy 那么不要直接进入 phpMyAdmin 并运行 sql 命令.

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

您必须转到 MySQL® 数据库 部分并在那里创建一个数据库.然后创建一个用户并授予它权限访问您刚刚创建的数据库.现在您可以转到 phpMyAdmin 并编写您的 SQL 命令.

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.

希望能帮到你

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

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Hibernate reactive No Vert.x context active in aws rds(AWS RDS中的休眠反应性非Vert.x上下文处于活动状态)
Bulk insert with mysql2 and NodeJs throws 500(使用mysql2和NodeJS的大容量插入抛出500)
Flask + PyMySQL giving error no attribute #39;settimeout#39;(FlASK+PyMySQL给出错误,没有属性#39;setTimeout#39;)
auto_increment column for a group of rows?(一组行的AUTO_INCREMENT列?)
Sort by ID DESC(按ID代码排序)
SQL/MySQL: split a quantity value into multiple rows by date(SQL/MySQL:按日期将数量值拆分为多行)