Mysql - don't forget if you set innodb_force_recovery

By Andy, filed under SQL

Today I got the following error message:

andy@andy-desktop:~/www$ mysql -uroot < db_dump.sql 
ERROR 1030 (HY000) at line 2564: Got error -1 from storage engine
  1. andy@andy-desktop:~/www$ mysql -uroot < db_dump.sql
  2. ERROR 1030 (HY000) at line 2564: Got error -1 from storage engine
  3.  

I couldn't figure out what could possibly be the cause - the file was valid and worked on another machine.

So that I don't forget the next time I come across this error, and that something exists on the web...

read more1 comment

  • Bake yourself a complete admin backend - in one call

    By Andy, filed under CakePHP, PRG

    Happy Christmas leveille!

    How would you like to be able to generate your entire admin backend in one call? Not interesting enough? How about with built in index filters and by writing practically no code? Well... keep reading then :).

    The code

    The code I am discussing here is available from the Noswad cakeforge project. Be sure to read the release note.

    ...

    read more17 comments

  • Speed up your dev: write custom bake templates

    By Andy, filed under CakePHP, Tools

    When I first started using cake, bake wasn't around. It took quite some time for me to decide to give it a go, but at that time what bake gave wasn't customizable, as such it's use was limited since it took nearly as much time to bake and edit the files as it did to just write the files (once you know what you are doing that is). Roll the clock forward a bit and bake ...

    read more5 comments

  • DRY: Applied to your setup

    By Andy, filed under CakePHP, Tips

    As pointed out in a recent comment, when changing your cake version you may find that some of your hand written config files are nolonger compatible with the version of cake you have selected. However by making use of a a custom production setup there is a way to configure your application defensively and in less lines of code.

    Every time I use copy, paste &...

    read more0 comments

  • read populates $model->data

    By Andy, filed under CakePHP

    For the past couple of days, I've had this niggling doubt that I've been missing something. Some code that I had in a behavior, which was supposed to be triggering a save for two field values, further down the line kept turning into a save which included every field in the table with the old field values. Why was this happening? I asked Elvis, he didn't know so I had to ...

    read more3 comments

  • Automatically track who makes Database changes

    By Andy, filed under CakePHP

    You may well find that you want to automatically know which user is adding or updating your database info. There are a few ways to do this and I recently, inadvertently, let slip that I have a whoDunnit (who did it) behavior which I use for exactly this purpose.

    I wasn't sure if I should make it public; trouble is a little knowledge is a dangerous thing, and the...

    read more8 comments

  • Generic File Upload Behavior

    By Andy, filed under CakePHP

    On a recent project I had to address the requirement that the admin user can "upload any type of file and associate it with any of the models in the system". In reality this seems to be a rather logical and common requirement. For quite a while now I've been collecting bits of info on how to upload files with cake and it's about time to begin sharing the knowledge. Did I say ...

    read more30 comments

  • Announcing ?DM0eight

    By Andy, filed under Real Life

    I usually only write about technical things here, but there are some things that are worth sharing. Still, it's boring to just blurt things out so for anyone reading the title to this blog thinking "huh?" (and I bet that's most of you) here are some hints to help figure out what it means:

    • My net name is AD7six
    • This is made up of my initials and the year I was...

    read more6 comments

« 1 | 2 | 3 | 4 | 5