Archive for December, 2009
Can’t create table – errno: 13
by Andrew on Dec.30, 2009, under Linux, MySQL, SQL
I came across a problem today when trying to create a temporary table in MySQL.
ERROR 1005 (HY000): Can't create table 'temptable' (errno: 13)
The first thing I checked was that the user in question had the Create_tmp_table_priv privilege in the users table, which it did.
The next step was to find out where MySQL was writing the temporary tables.
The following command tells us this:
show variables like '%dir'; +---------------------------+----------------------------+ | Variable_name | Value | +---------------------------+----------------------------+ | basedir | /usr/ | | bdb_logdir | | | bdb_tmpdir | /tmp/ | | character_sets_dir | /usr/share/mysql/charsets/ | | datadir | /var/lib/mysql/ | | innodb_data_home_dir | | | innodb_log_arch_dir | | | innodb_log_group_home_dir | ./ | | slave_load_tmpdir | /tmp/ | | tmpdir | /tmp/ | +---------------------------+----------------------------+
And from that we see the tmpdir is located in /tmp/.
A quick checked revealed that MySQL could not create files in this directory, no write access, so a simple permissions change and all was well again.
RPM scriptlet failed
by Andrew on Dec.17, 2009, under Linux
I came across a problem when trying to remove an RPM using `rpm -e` which caused this following error to come up.
# rpm -e PACKAGE find: ....... No such file or directory error: %preun(PACKAGE) scriptlet failed, exit status 1
To fix this, I added `—noscripts` to the end of the line and it removed without a problem.