Having a long-term H. pylori infection is one of the main risks for stomach cancer. However, most people who have this bacteria in their stomach never develop cancer. Obesity, excessive alcohol use, smoking, and a diet high in preservatives and salt can also increase your risk.