2

I'm quite new to server administration but a keen learner, so if I miss anything or you need any extra info let me know and I'll do my best to provide it ASAP :)

I'm running WordPress on a developer plan VPS over at media temple (meaning I have root access, everything is managed by me etc). My OS is Fedora, Apache is latest version and am using MariaDB for MySQL.

When trying to read/write menus from the WP admin panel Apache writes this to its error log:

[Fri Dec 13 04:28:59.296672 2013] [:error] [pid 11195] [client (my IP, omitted)] WordPress database error Can't create/write to file '/var/tmp/#sql_1ff_0.MAI' (Errcode: 2) for query (**lots of different queries**)

This error repeats for about 20 different queries, and I've checked with perror that error code 2 for SQL means "No such file or directory".

I would contact my host about this problem, but as I said I'm on a developer plan meaning they won't help me with anything. Generally from Googling around I can find an answer or solution but in this case I've come up with nothing.

MadHatter
  • 79,770
  • 20
  • 184
  • 232
aaa
  • 21
  • 1
  • 2

1 Answers1

0

You can use the perror command to get an explanation on system errors:

~]$ perror 2
OS error code   2:  No such file or directory

It may be that the directory /var/tmp/ does not exist.

Alternatively the WordPress MySQL user may not have been granted sufficient permissions to create files. You may need to GRANT FILE and/or CREATE TEMPORARY TABLES priviliges to the WordPress user. Refer to the the GRANT manual page.

HBruijn
  • 77,029
  • 24
  • 135
  • 201
  • 1
    Or the permissions on `/var/tmp` may be wrong (should be 1777). – MadHatter Dec 13 '13 at 12:29
  • @HBruijn /var/tmp does exist (from root, that's where I presume you're referring to). Additionally, my WordPress MySQL user has access to `FILE` and `CREATE TEMPORARY TABLES` privs. @MadHatter The permissions on /var/tmp are 1777 and I've even changed the ownership to mysql[27]. – aaa Dec 13 '13 at 12:53
  • I would love to hear any other suggestions though, because I'm exhausted. I've spent over 18 hours researching and trying to fix this 1 stupid problem – aaa Dec 13 '13 at 12:57
  • 1
    More reasons not being able to write could be a full partition (`df`), read-only volume (`mount`) or possibly SELinux related (`getenforce`). – HBruijn Dec 13 '13 at 13:10
  • All mounts have loads of space, the file system is not read-only because I am able to create folders/files manually, and getenforce=disabled. This whole problem is getting to be a bit of a joke.. Would it be worth trying setting a tmpdir in my.cnf for SQL (I've tried once, yes I made sure mysql had permissions for the new directory but it still didnt work)? Is there any more detailed method of debugging this error to find out more info? – aaa Dec 13 '13 at 13:23
  • The .MAI file exention is apparently used by the MariaDB aria engine for indexes. So it may be an `INDEX` privilege? – HBruijn Dec 13 '13 at 13:35