1044 - Access denied for user #39;user#39;@#39;localhost#39; to database #39;db#39;(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' 的访问被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:1044 - 用户 'user'@'localhost' 对数据库 'db' 的访问被拒绝


基础教程推荐
- 在 VB.NET 中更新 SQL Server DateTime 列 2021-01-01
- ERROR 2006 (HY000): MySQL 服务器已经消失 2021-01-01
- SQL Server 2016更改对象所有者 2022-01-01
- SQL Server 中单行 MERGE/upsert 的语法 2021-01-01
- 将数据从 MS SQL 迁移到 PostgreSQL? 2022-01-01
- 无法在 ubuntu 中启动 mysql 服务器 2021-01-01
- Sql Server 字符串到日期的转换 2021-01-01
- SQL Server:只有 GROUP BY 中的最后一个条目 2021-01-01
- 如何在 SQL Server 的嵌套过程中处理事务? 2021-01-01
- 使用pyodbc“不安全"的Python多处理和数据库访问? 2022-01-01