Have you checked that the support-files end up where you want them?
Earlier you had `system "cp -r ./support-files #{prefix}/support-files"` which would put them in to `/usr/local/Cellar/mysql40/x.y.z/support-files`. Perhaps have a look at the current mysql formula in mxcl/master ?
There is a inreplace, too, in order to change the PATH in mysql.server.