"Summary of Use during Lactation:
Cephalexin is acceptable to use during breastfeeding. Limited information indicates that maternal doses of cephalexin up to 1 gram produce low levels in milk that are not expected to cause adverse effects in breastfed infants. Occasionally, disruption of the infant's gastrointestinal flora, resulting in diarrhea or thrush, have been reported with cephalosporins, but these effects have not been adequately evaluated."
http://toxnet.nlm.nih.gov/cgi-bin/sis/htmlgen?LACT (search term=keflex)
I would urge you to consider probiotic supplements for both you and your baby. Some info:
I would urge you to try moist wound healing. Lansinoh is a very popular ointment that many lactation professionals recommend. Moist wound healing not only means that the sore is less likely to dry out and re-open repeatedly, it also protects the area and makes it less painful.
Here's some helpful info:
Feel better soon!