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' 的访问被拒绝


- 如何将 SonarQube 6.7 从 MySQL 迁移到 postgresql 2022-01-01
- 在SQL中,如何为每个组选择前2行 2021-01-01
- 远程 mySQL 连接抛出“无法使用旧的不安全身份验证连接到 MySQL 4.1+"来自 XAMPP 的错误 2022-01-01
- 如何将 Byte[] 插入 SQL Server VARBINARY 列 2021-01-01
- 以一个值为轴心,但将一行上的数据按另一行分组? 2022-01-01
- 导入具有可变标题的 Excel 文件 2021-01-01
- SQL 临时表问题 2022-01-01
- 使用 Oracle PL/SQL developer 生成测试数据 2021-01-01
- 如何使用 pip 安装 Python MySQLdb 模块? 2021-01-01
- 更改自动增量起始编号? 2021-01-01