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' 的访问被拒绝
基础教程推荐
- mysql选择动态行值作为列名,另一列作为值 2021-01-01
- 二进制文件到 SQL 数据库 Apache Camel 2021-01-01
- 如何在 SQL 中将 Float 转换为 Varchar 2021-01-01
- 如何根据该 XML 中的值更新 SQL 中的 XML 2021-01-01
- 什么是 orradiag_<user>文件夹? 2022-01-01
- MySQL 中的类型:BigInt(20) 与 Int(20) 2021-01-01
- 在 MySQL 中:如何将表名作为存储过程和/或函数参数传递? 2021-01-01
- 表 './mysql/proc' 被标记为崩溃,应该修复 2022-01-01
- oracle区分大小写的原因? 2021-01-01
- 在多列上分布任意行 2021-01-01
