Our Mysql queries use temporary tables which creates temporary files in the process. Currently the files are written to /tmp. How exactly can the path of the temp folder to which mysql writes to be changed?
相关问题
- sqlyog export query result as csv
- NOT DISTINCT query in mySQL
- MySQL: conduct a basic search
- Why sometimes there is one of more gap(s) in the v
- mySQL alter table on update, current timestamp
Here is an example to move the mysqld tmpdir from /tmp to /run/mysqld which already exists on Ubuntu 13.04 and is a tmpfs (memory/ram):
Add:
Then:
Verify:
==================================================================
If you get an error on MySQL restart, you may have AppArmor enabled:
Add:
Then:
sources: http://2bits.com/articles/reduce-your-servers-resource-usage-moving-mysql-temporary-directory-ram-disk.html, https://blogs.oracle.com/jsmyth/entry/apparmor_and_mysql
if you dont have apparmor or selinux issues, but still get errorcode 13's:
mysql must be able to access the full path. I.e. all folders must be mysql accessible, not just the one you intend in pointing to.
example, you try using this in your mysql configuration:
tmp = /some/folder/on/disk
You should edit your my.cnf
and after that restart mysql
P.S. Don't forget give write permissions to
/whatewer/you/want
for mysql userThis is answered in the documentation:
Where MySQL Stores Temporary Files