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.
希望能帮到你
相关文章