A kidney infection (pyelonephritis) is a painful and unpleasant illness caused by bacteria travelling from your bladder into one or both of your kidneys. It's more serious than cystitis, a common infection of the bladder that makes urinating painful.