MySQL: Difference between revisions

From Han Wiki
Jump to navigation Jump to search
iwu
 
Line 11: Line 11:


Make sure that the mysql daemon (mysql:mysql on Ubuntu) is able to write to the folder.
Make sure that the mysql daemon (mysql:mysql on Ubuntu) is able to write to the folder.
<span class="package">apparmor</span> status can be checked via <span class="shell">sudo aa-status</span>.


Disable apparmor temporary ( <code>service apparmor teardown</code> ) execute the above command and then restart it again ( <code>service apparmor start</code> ).
Disable apparmor temporary ( <code>service apparmor teardown</code> ) execute the above command and then restart it again ( <code>service apparmor start</code> ).


[[Category:System administration]]
[[Category:System administration]]

Revision as of 13:54, 24 June 2016

mysqldump returning Errcode 13

  • Last tested on Ubuntu 14.04.2 LTS (trusty)

When I try to create a CSV file from a table in the database I'd get an Errcode 13. Here I'm trying to extract a table called enc_codes3 from a database called testdb

mhan@dbserver:~$ mysqldump --tab=./testdump -uroot -p --fields-terminated-by=, --fields-enclosed-by='"' --lines-terminated-by=0x0d0a -t testdb enc_codes3
Enter password:
mysqldump: Got error: 1: Can't create/write to file '/home/mhan/testdump/enc_codes3.txt' (Errcode: 13) when executing 'SELECT INTO OUTFILE'

Make sure that the mysql daemon (mysql:mysql on Ubuntu) is able to write to the folder.

apparmor status can be checked via sudo aa-status.

Disable apparmor temporary ( service apparmor teardown ) execute the above command and then restart it again ( service apparmor start ).