Linux下MySQL的寫文件時權限錯誤(Errcode: 13)解決方法 在數據庫中用select * into outfile '/home/mysql/data.sql'導出數據時 shell提示錯誤: ERROR 1 (HY000): Can't create/write to file '/home/mysql/data.sql' (Errcode: 13) 在確認不是權限的問題後,用下面方法解決 setsebool -P mysqld_disable_trans=1 執行上述命令後, 重啟mysql服務,shell不會在報錯 shell>getsebool -a可以查看當前的對系統一系列守護進程的權限情況。 lpd_disable_trans --> off mail_read_content --> off mailman_mail_disable_trans --> off mdadm_disable_trans --> off mozilla_read_content --> off mysqld_disable_trans --> off nagios_disable_trans --> off named_disable_trans --> off named_write_master_zones --> off nfs_export_all_ro --> on nfs_export_all_rw --> on nfsd_disable_trans --> off nmbd_disable_trans --> off nrpe_disable_trans --> off -P表示 是永久性設置,否則重啟之後又恢復預設值。