  We constrain the photon mass from well-localized fast radio bursts (FRBs)
using Bayes inference method. The probability distributions of dispersion
measures (DM) of host galaxy and intergalactic medium are properly taken into
account. The photon mass is tightly constrained from 17 well-localized FRBs in
the redshift range $0<z<0.66$. Assuming that there is no redshift evolution of
host DM, the $1\sigma$ and $2\sigma$ upper limits of photon mass are
constrained to be $m_\gamma<4.8\times 10^{-51}$ kg and $m_\gamma<7.1\times
10^{-51}$ kg, respectively. Monte Carlo simulations show that, even enlarging
the FRB sample to 200 and extending the redshift range to $0<z<3$ couldn't
significantly improve the constraining ability on photon mass. This is because
of the large uncertainty on the DM of intergalactic medium.
