January 13, 2009

requested_mask / denied_mask errors on Ubuntu with Mysql

Filed under: linux,mysql,ubuntu — @ 14:48

I’ve recently set up some new msql-servers that had to fetch their data from a shared mountpoint. I changed the mysql configuration so that it was no longer looking in /var/lib/mysql but in /mounted/mysql. Unfortunately mysql failed to start because of insufficient permissions( type=1503 operation=â€?inode_permissionâ€? requested_mask=â€?rw::â€? denied_mask=â€?rw::â€? name=â€?/mounted/mysql/ibdata1″ pid=7588 profile=â€?/usr/sbin/mysqldâ€? namespace=â€?defaultâ€?

This is caused by apparmor. You need to edit the file /etc/apparmor.d/usr.sbin.mysqld and then look for the lines /var/lib/mysql. Replace this with your path and restart apparmor and mysql.

/etc/init.d/apparmor restart
/etc/init.d/mysql restart

January 24, 2008

mysql error “ERROR 1030: Got error 134 from table handler”

Filed under: mysql — @ 17:08

If you try to insert or select data from a table and you get an error message from mysql that says

ERROR 1030: Got error 134 from table handler

then you have repair the table.

December 24, 2007

Mysql Slice a resultset

Filed under: internet,mysql,php — @ 01:36

Slicing a mysql result is easy with

select from_unixtime(unix_timestamp(timestamp) -unix_timestamp(timestamp) % $slicecount) as slice, count(*) from event group
by slice

This will return the mysql statement sliced on the given number of slices.