Sunday, January 28, 2007

In a deadirectory

After some apt-get update and apt-get install, I get this funny error message when I try to restart apache:

"shell-init: could not get current directory: getcwd: cannot access parent directories: No such file or directory"

But the command runs fine.

Something felt familiar ... oh right. This is a UNIX error message for "you are in a directory that no longer exists".

Monday, January 01, 2007

Mysql broken increment

Changing table names, I changed the name of the primary key as well, and forgot to set all the attributes.

If you don't, things start to break, because the attributes aren't "saved" for you in any way. For example, the auto-increment stops working, the table is no longer functional, and you get this error:

Duplicate entry '0' for key 1

To fix this, add the attributes to the primary key field. This won't hurt the values (at least, it didn't for me):

alter table X change column key_name key_name int(12) unsigned not null auto_increment