Not a kamailio code bug -- it looks like mysql server is not started at that time. Maybe @linuxmaniac can add comments here and see whether or not something else needs to be specified in the startup service script to set the order after mysql server.