You shouldn’t disconnect a single battery cable when the engine is running. Let alone replacing the entire battery. Please act as a normal human and turn off the engine before you replace your car battery.