Applying AdS/CFT correspondence, we study the effect of a constant magnetic field B on the drag force associated with a heavy quark moving through a strongly-coupled N = 4 supersymmetric Yang-Mills (SYM) plasma. The quark is considered moving transverse and parallel to B, respectively. It is shown that for transverse case, the drag force is linearly dependent on B in all regions. While for parallel case, the drag force increases monotonously with increasing B and also reveals a linear behavior in the regions of strong B. In addition, we find that B has important effect for transverse case than parallel. PACS numbers: 12.38.Mh, 11.25.Tq, 11.15.Tk √ λB 6π v. However, the metric therein is valid only near the horizon, so the discussions are restricted to the infrared (IR) regime. In this paper, we would like to extend it to the case of all regimes by considering a general magnetic field. Specially, we want to know how an arbitrary magnetic field affects the drag force.The paper is organized as follows. In the next section, we briefly review the asymptotic AdS 5 holographic Einstein-Maxwell model and introduce the background metric in the presence of a magnetic field. In section 3, we show numerical procedure and some numerical solutions. In section 4, we investigate the drag force for the quark moving transverse and parallel to the magnetic field, in turn. The last part is devoted to conclusion and discussion.