0

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.
4

1 に答える 1

1

手動でログインする場合も、そのSQLファイルを実行できることを確認してください。あなたのSQLステートメントはその指定されたユーザー(-uDB)によって実行可能ではないと思います。このエラーは、必ずしもMySQLにログインしていないことを意味するわけではなく、スクリプトを実行するための権限がないことを意味している可能性があります。

次のような簡単なステートメントを実行してログインを試すことができます

mysql DB -uDB -pPASS < SHOW TABLES
于 2012-12-30T03:31:44.790 に答える