【问题标题】:mysql: ERROR 1044 (42000) at line 41: Access denied for usermysql: ERROR 1044 (42000) at line 41: Access denied for user
【发布时间】:2012-12-30 02:58:33
【问题描述】:

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

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

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:

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.

【问题讨论】:

    标签: mysql permissions


    【解决方案1】:

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

    您可以通过执行简单的语句来尝试登录,例如

    mysql DB -uDB -pPASS < SHOW TABLES
    

    【讨论】:

      猜你喜欢
      • 2019-03-29
      • 2014-03-10
      • 2017-04-19
      • 2015-03-20
      • 1970-01-01
      • 1970-01-01
      • 2019-06-05
      • 2019-11-11
      • 2023-03-23
      相关资源
      最近更新 更多