Difference of write authorization on file system with mySQL
Your problem is that MySQL cannot write to your home directory, as by default it will run as the MySQL user, or as some other user you defined when you installed and configured it, if not using the default rpm or other install package. Users are not, by default, able to write to another user's home directory as it is each account's private space.

/tmp is by default writable by all users. As such MySQL can write there. Depending on user groups and umask on your system you may be able to read that output as your user.

If you don't want to use /tmp you could create another directory where your user and MySQL can write and make sure your user and MySQL are members of the same group.