Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've got a query that keeps failing because I don't have enough temporary space available. So, I created a directory on a different partition at /data/tmp, chmoded this directory to 777, and updated my.cnf to read: tmpdir = /data/tmp. I'm able to restart the daemon without a hitch, and no errors reported in the logs. This is all the logs show upon restarting the daemon:

Mar 17 16:45:05 Casala-Dev-LX01 /etc/mysql/debian-start[3166]: Upgrading MySQL tables if necessary.
Mar 17 16:45:05 Casala-Dev-LX01 /etc/mysql/debian-start[3169]: /usr/bin/mysql_upgrade: the '--basedir' option is always ignored
Mar 17 16:45:05 Casala-Dev-LX01 /etc/mysql/debian-start[3169]: Looking for 'mysql' as: /usr/bin/mysql
Mar 17 16:45:05 Casala-Dev-LX01 /etc/mysql/debian-start[3169]: Looking for 'mysqlcheck' as: /usr/bin/mysqlcheck
Mar 17 16:45:05 Casala-Dev-LX01 /etc/mysql/debian-start[3169]: This installation of MySQL is already upgraded to 5.1.41, use --force if you still need to run mysql_upgrade
Mar 17 16:45:05 Casala-Dev-LX01 /etc/mysql/debian-start[3176]: Checking for insecure root accounts.
Mar 17 16:45:05 Casala-Dev-LX01 /etc/mysql/debian-start[3180]: Triggering myisam-recover for all MyISAM tables
Mar 17 16:45:05 Casala-Dev-LX01 kernel: [93900.335357] type=1503 audit(1300380305.417:117):  operation="mknod" pid=3164 parent=1 profile="/usr/sbin/mysqld" requested_mask="c::" denied_mask="c::" fsuid=104 ouid=104 name="/data/tmp/#sql_c54_1.MYI"
Mar 17 16:45:05 Casala-Dev-LX01 kernel: [93900.335453] type=1503 audit(1300380305.417:118):  operation="mknod" pid=3164 parent=1 profile="/usr/sbin/mysqld" requested_mask="c::" denied_mask="c::" fsuid=104 ouid=104 name="/data/tmp/#sql_c54_1.MYI"
Mar 17 16:45:05 Casala-Dev-LX01 kernel: [93900.335553] type=1503 audit(1300380305.417:119):  operation="mknod" pid=3164 parent=1 profile="/usr/sbin/mysqld" requested_mask="c::" denied_mask="c::" fsuid=104 ouid=104 name="/data/tmp/#sql_c54_1.MYI"
Mar 17 16:45:05 Casala-Dev-LX01 kernel: [93900.335591] type=1503 audit(1300380305.417:120):  operation="mknod" pid=3164 parent=1 profile="/usr/sbin/mysqld" requested_mask="c::" denied_mask="c::" fsuid=104 ouid=104 name="/data/tmp/#sql_c54_1.MYI"
Mar 17 16:45:05 Casala-Dev-LX01 kernel: [93900.335628] type=1503 audit(1300380305.417:121):  operation="mknod" pid=3164 parent=1 profile="/usr/sbin/mysqld" requested_mask="c::" denied_mask="c::" fsuid=104 ouid=104 name="/data/tmp/#sql_c54_1.MYI"
Mar 17 16:45:05 Casala-Dev-LX01 kernel: [93900.335731] type=1503 audit(1300380305.417:122):  operation="mknod" pid=3164 parent=1 profile="/usr/sbin/mysqld" requested_mask="c::" denied_mask="c::" fsuid=104 ouid=104 name="/data/tmp/#sql_c54_1.MYI"
Mar 17 16:45:05 Casala-Dev-LX01 kernel: [93900.335893] type=1503 audit(1300380305.417:123):  operation="mknod" pid=3164 parent=1 profile="/usr/sbin/mysqld" requested_mask="c::" denied_mask="c::" fsuid=104 ouid=104 name="/data/tmp/#sql_c54_1.MYI"
Mar 17 16:55:32 Casala-Dev-LX01 kernel: [94526.730200] type=1503 audit(1300380932.157:125):  operation="mknod" pid=3164 parent=1 profile="/usr/sbin/mysqld" requested_mask="c::" denied_mask="c::" fsuid=104 ouid=104 name="/data/tmp/#sql_c54_0.MYI"
Mar 17 16:55:32 Casala-Dev-LX01 kernel: [94526.753333] type=1503 audit(1300380932.177:126):  operation="mknod" pid=3164 parent=1 profile="/usr/sbin/mysqld" requested_mask="c::" denied_mask="c::" fsuid=104 ouid=104 name="/data/tmp/#sql_c54_0.MYI"
Mar 17 16:55:40 Casala-Dev-LX01 kernel: [94534.677693] type=1503 audit(1300380940.107:127):  operation="mknod" pid=3164 parent=1 profile="/usr/sbin/mysqld" requested_mask="c::" denied_mask="c::" fsuid=104 ouid=104 name="/data/tmp/#sql_c54_0.MYI"
Mar 17 16:55:40 Casala-Dev-LX01 kernel: [94534.837802] type=1503 audit(1300380940.267:128):  operation="mknod" pid=3164 parent=1 profile="/usr/sbin/mysqld" requested_mask="c::" denied_mask="c::" fsuid=104 ouid=104 name="/data/tmp/#sql_c54_0.MYI"

When I login to the database, however, InnoDB tables just don't work. I keep getting the error, ERROR 1286 (42000): Unknown table engine 'InnoDB'. MyISAM tables work just fine. I read here that this might be an issue with the size specified for innodb_buffer_pool_size, so I tried a range of sizes, all the way down to 32M. Regardless of this setting though, the daemon continues to start correctly, the InnoDB engine fails silently (confirmed through SHOW ENGINES;), and I continue to grow more frustrated.

share|improve this question
1  
The audit messages indicate that your AppArmor profile forbids whatever it is mysql is trying to do in /data/tmp. –  DerfK Mar 17 '11 at 18:26

1 Answer 1

up vote 4 down vote accepted

Expanding on DerfK's apparmor suggestion, check your apparmor config

Ubuntu:

/etc/apparmor.d/usr.bin.mysqld

add

/data/tmp/ r,  
/data/tmp/* rw

to the list of directories.

share|improve this answer
    
Argh...I knew that. Thanks for the reminder. Talk about an ambiguous log entry, though! –  Brennon Bortz Mar 17 '11 at 21:57

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.