2013-04-26 64 views
0

C:\ Projects \ k> mysqldump --tab = c:\ temp \ multifile -ps -us s mysqldump:收到錯誤:1:無法創建/寫入文件'執行'SELECT INTO OUTFILE'時出現'c:\ temp \ multifile \ archive.txt'(Errcode:13)Mysqldump不想導出數據

如何在Windows上修復它?我對此用戶沒有任何限制...

+0

http://stackoverflow.com/questions/4250243/select-into-outfile-cant -write-to-file – zod 2013-04-26 22:51:11

+0

http://stackoverflow.com/questions/2783313/how-can-i-get-around-mysql-e rrcode-13-with-select-into-outfile – zod 2013-04-26 22:52:36

+0

他們都沒有幫助我,爲目標文件夾添加完全訪問權限幫助了我。 – 2013-04-27 19:03:15

回答

1

Windows錯誤13是「權限被拒絕」。也許文件已經存在,你不能刪除它,這將需要創建一個名稱的新文件。

+1

授予對Windows中的文件夾的完全訪問權限,可解決此問題 – 2013-04-27 05:42:30

0

首先幾個想法:是否有足夠的空間? MySQL有權寫入嗎?

我發現的另一件事:關閉掃描窗口/臨時文件夾中的防病毒解決了我的問題。

希望它有幫助

0

我在win7和Wn2008 R2上有類似的錯誤 - 錯誤13「權限被拒絕」。嘗試所有建議的解決方案都不起作用。

我創建了一個文件夾,例如c:\ temp,並完全控制登錄用戶。問題解決了。


右鍵單擊目標文件夾 - >屬性 - >安全 - >編輯...,確保權限在活動用戶下可編輯。

我發現如果「活動」用戶的「允許」權限在目標文件夾中顯示爲灰色,也會出現此問題。在創建新文件夾並授予完全控制權限之後,所有權限都是可編輯的,並且沒有更多權限錯誤。

1

可能的原因:

  1. 這是輸出的,當我與用戶運行mysqldumpwork

    $ ll 
    total 908 
    -rw-rw-r-- 1 work work 1824 Apr 28 14:47 test.sql 
    -rw-rw-rw- 1 mysql mysql 922179 Apr 28 14:47 test.txt 
    

    test.sql由用戶work創建,而是由用戶mysql創建的test.txt,所以是「沒有權限!」。在這種情況下,你應該chmod你的目錄。

  2. It is best that --tab be used only for dumping a local server. If you use it with a remote server, the --tab directory must exist on both the local and remote hosts, and the .txt files will be written by the server in the remote directory (on the server host), whereas the .sql files will be written by mysqldump in the local directory (on the client host).

    參見:Dumping Data in Delimited-Text Format with mysqldump

  3. You need the FILE privilege in order to be allowed to use SELECT...INTO OUTFILE, which seems to be what mysqldump --tab uses to generate the tab-separated dump.

    This privilege is global, which means it may only be granted "ON ." :

    GRANT FILE ON *.* TO 'backup'@'%'; 
    

    參見:Which are the proper privileges to mysqldump for the Error Access denied when executing 'SELECT INTO OUTFILE'.?