Long time no see!?! (and a little bit of wordpress woe)
- March 1st, 2009
- Posted in chat
- Write comment
So its been nearly an entire year since I’ve posted last….AND the site has been down for roughly six months of that! But I’ve got some bits I wanted to share – so I’ve brought back the site.
I’ve recently bought a Sony Gigajuke stereo – which after some investigation, runs Linux and I’ve finally managed (took me most of Friday night! – sad uh?
to get r00t on! and not just over some serial interface – I’ve got full remote SSH access to my stereo! I plan on writting that up incase anyone else fancys giving it a go. I’m not sure if anyone out there is playing with the same bit of kit but I couldn’t find any pages?! – let me know if you are!
And finally – while bring my wordpress blog back to life (from an old tgz), I thouht I’d upgrade to the latest shinny version. Last time I upgraded it was compleatly painless – this time (upgrading to 2.7.1) wasn’t as easy and I couldn’t find the answer out on the net – so here’s the solution to the problem I was having.
I was seeing this in my apache error.log:
WordPress database error Duplicate entry '0' for key 1 for query INSERT INTO wp_postsĀ .....
And I couldn’t make any posts etc.
So I started having a look around the database; it seems the upgrade script has forgotten to add auto_increament to a bunch of fields in the database – so when new rows are added their id fields are colliding. The fix is nice and easy – add auto_increament to a bunch of fields:
mysql -u <your db username> -p <your db name> #enter your password ALTER table wp_posts modify column ID bigint(20) unsigned auto_increment; ALTER table wp_comments modify column comment_ID bigint(20) unsigned auto_increment; ALTER table wp_links modify column link_id bigint(20) auto_increment; ALTER table wp_users modify column ID bigint(20) unsigned auto_increment; ALTER table wp_usermeta modify column umeta_id bigint(20) auto_increment; ALTER table wp_postmeta modify column meta_id bigint(20) auto_increment;
Assuming your table prefix is the default (wp) then that should work and now you should beable to post again! I’ve quite possibly missed some other fields that need updating – but it works for me! But then again I don’t really use all the wordpress features.
Hope its helps anyway.
Ohh.. yeah that helps! ..thanks for that, I was bashing my head against a WP install trying to figure out why posts didn’t work