2012-12-30 154 views
0

我正面臨mysql的一個奇怪的權限錯誤。第41行的mysql:錯誤1044(42000):拒絕用戶的訪問

當我嘗試上傳備份我得到:

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領事:

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. 

回答

1

檢查可以運行該手動登錄時的SQL文件。我猜你的SQL語句不能被指定的用戶(-uDB)執行。錯誤並不一定意味着你還沒有登錄到MySQL,它很可能意味着你沒有權限運行該腳本

你可以通過執行一個簡單的語句,如

​​ 嘗試登錄
相關問題