首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >mysql:第41行出现错误1044 (42000):拒绝用户访问

mysql:第41行出现错误1044 (42000):拒绝用户访问
EN

Stack Overflow用户
提问于 2012-12-30 10:58:33
回答 1查看 2.1K关注 0票数 0

我在mysql中遇到了一个奇怪的权限错误。

当我尝试上传备份时,我得到:

代码语言:javascript
复制
mysql DB -uDB -pPASS < files.30.12.12.sql
ERROR 1044 (42000) at line 41: Access denied for user 'DB'@'localhost' to database 'DB'

奇怪的是,我可以使用相同的用户名和密码登录到mysql consul:

代码语言:javascript
复制
mysql DB -uDB -pPASS
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 51
Server version: 5.5.27-28.1 Percona Server (GPL), Release rel28.1, Revision 296

Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
EN

回答 1

Stack Overflow用户

发布于 2012-12-30 11:31:45

检查您是否也可以在手动登录时运行该SQL文件。我猜您的SQL语句不能由指定的用户(-uDB)执行。该错误并不一定意味着您未登录到MySQL,它很可能意味着您没有运行该脚本的权限

您可以通过执行如下所示的简单语句来尝试登录

代码语言:javascript
复制
mysql DB -uDB -pPASS < SHOW TABLES
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14087933

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档