Correct mysqld setup and control status.

Also add WIP connection hook.