Just be careful with doses that can cause loose stools. Also, magnesium supplements can interfere with the absorption of certain medications.
From WebMD:
MAGNESIUM INTERACTIONS What is this?
Moderate Interaction Be cautious with this combination
Antibiotics (Aminoglycoside antibiotics) interacts with MAGNESIUM
Some antibiotics can affect the muscles. These antibiotics are called aminoglycosides. Magnesium can also affect the muscles. Taking these antibiotics and getting a magnesium shot might cause muscle problems.
Some aminoglycoside antibiotics include amikacin (Amikin), gentamicin (Garamycin), kanamycin (Kantrex), streptomycin, tobramycin (Nebcin), and others.
Antibiotics (Quinolone antibiotics) interacts with MAGNESIUM
Magnesium might decrease how much antibiotic the body absorbs. Taking magnesium along with some antibiotics might decrease the effectiveness of some antibiotics. To avoid this interaction take these antibiotics at least 2 hours before, or 4 to 6 hours after, magnesium supplements.
Some of these antibiotics that might interact with magnesium include ciprofloxacin (Cipro), enoxacin (Penetrex), norfloxacin (Chibroxin, Noroxin), sparfloxacin (Zagam), trovafloxacin (Trovan), and grepafloxacin (Raxar).
Antibiotics (Tetracycline antibiotics) interacts with MAGNESIUM
Magnesium can attach to tetracyclines in the stomach. This decreases the amount of tetracyclines that the body can absorb. Taking magnesium along with tetracyclines might decrease the effectiveness of tetracyclines. To avoid this interaction take calcium 2 hours before or 4 hours after taking tetracyclines.
Some tetracyclines include demeclocycline (Declomycin), minocycline (Minocin), and tetracycline (Achromycin).
Bisphosphonates interacts with MAGNESIUM
Magnesium can decrease how much bisphosphate the body absorbs. Taking magnesium along with bisphosphates can decrease the effectiveness of bisphosphate. To avoid this interaction take bisphosphonate at least two hours before magnesium or later in the day.
Some bisphosphonates include alendronate (Fosamax), etidronate (Didronel), risedronate (Actonel), tiludronate (Skelid), and others.
Medications for high blood pressure (Calcium channel blockers) interacts with MAGNESIUM
Magnesium might decrease blood pressure. Taking magnesium with medication for high blood pressure might cause your blood pressure to go too low.
Some medications for high blood pressure include nifedipine (Adalat, Procardia), verapamil (Calan, Isoptin, Verelan), diltiazem (Cardizem), isradipine (DynaCirc), felodipine (Plendil), amlodipine (Norvasc), and others.
Muscle relaxants interacts with MAGNESIUM
Magnesium seems to help relax muscles. Taking magnesium along with muscle relaxants can increase the risk of side effects of muscle relaxants.
Some muscle relaxants include carisoprodol (Soma), pipecuronium (Arduan), orphenadrine (Banflex, Disipal), cyclobenzaprine, gallamine (Flaxedil), atracurium (Tracrium), pancuronium (Pavulon), succinylcholine (Anectine), and others.
Water pills (Potassium-sparing diuretics) interacts with MAGNESIUM
Some "water pills" can increase magnesium levels in the body. Taking some "water pills" along with magnesium might cause too much magnesium to be in the body.
Some "water pills" that increase magnesium in the body include amiloride (Midamor), spironolactone (Aldactone), and triamterene (Dyrenium).