Guns work too.
I have been reading more in the last few months about knives being used, especially in states which restrict or ban firearms.
I have also seen and heard about the use of fire extinguishers, which have been used successfully - to drive the attacking dog off (unfamiliar and sounds/looks like a snake).
And they are apparently also effective if aimed directly into the mouth, nose and breathing passages to restrict breathing, to get the dog to open its mouth and release the victim.