Saturday, 15 June 2013

mysql - Error creating temp table -



mysql - Error creating temp table -

i attempting create temp table

create temporary table `test_table` ( `test` date not null );

even if seek other schemas next error

can't create table 'db.test_table' (errno: -1)

i tried google -1 error no luck.

let's summarize:

make sure have privilege "create temporary tables"

you might need specify exact engine want use

create temporary table `test_table` ( `test` date not null ) engine=memory;

make sure security software, "apparmor", doesn't have impact on mysqls behaviour looking @ it's configuration. "tmpdir" protection.

steps alter apparmor temp dir:

create new folder , alter ownership mysql

mkdir /mnt/foo/tmp sudo chown mysql:mysql /mnt/foo/tmp

edit /etc/mysql/my.cnf allow mysql utilize new tmpdir

tmpdir = /mnt/foo/tmp

edit /etc/apparmor.d/local/usr.sbin.mysqld allowing reading , writing folder

/mnt/foo/tmp/ r, /mnt/foo/tmp/** rw,

restart services

sudo service apparmor reload sudo service mysql restart

mysql temp-tables create-table derived-table

No comments:

Post a Comment