A search is performed for heavy Majorana neutrinos (N) using an event signature defined by two muons of the same charge and two jets (mu+/- mu+/- jj). The data correspond to an integrated luminosity of 19.7 inverse femtobarns of proton-proton collisions at a center-of-mass energy of 8 TeV, collected with the CMS detector at the CERN LHC. No excess of events is observed beyond the expected standard model background and upper limits are set on abs(V[mu,N])^2 as a function of Majorana neutrino mass m[N] for masses in the range of 40-500 GeV, where V[mu,N] is the mixing element of the heavy neutrino with the standard model muon neutrino. The limits obtained are abs(V[mu,N])^2 < 0.00470 for m[N] = 90 GeV, abs(V[mu,N])^2 < 0.0123 for m[N] = 200 GeV, and abs(V[mu,N])^2 < 0.583 for m[N] = 500 GeV. These results extend considerably the regions excluded by previous direct searches.