Inclusion Criteria:
1. DM1 or DM2 diagnosis confirmed genetically;
2. Ability to comprehend and willingness to sign an informed consent (ICF) or ICF of the parent(s)/legal guardian and written assent from the patient (if patient \< 18 years of age);
3. Ability to understand the study requirements including intention to stay in the study until the end-of-study visit at 26 weeks of treatment;
4. Male or non-pregnant female ≥16 years of age;
5. Body Mass Index (BMI) of 18.5 kg/m2 to 30 kg/m2, and weight ≥45 kg;
6. Female patients of childbearing potential must be using a highly effective form of birth control for the duration of the study and for at least 7 days after last dose of study drug;
7. No significant cardiac abnormalities as determined by a cardiologist's assessment;
8. Have sufficient finger flexor strength to grasp the handle of the dynamometer used to measure myotonia;
9. DM1 patients only - Muscular impairment rating scale (MIRS) score of 2, 3 or 4.
Exclusion Criteria:
1. Are pregnant or lactating;
2. Have any one of the following medical conditions: uncontrolled diabetes mellitus, cancer other than skin cancer less than five years previously (e.g., basal-cell carcinoma (BCC) and squamous-cell carcinoma (SCC) of skin allowed), multiple sclerosis, seizure disorders, or other serious medical illness;
3. Severe renal impairment (glomerular filtration rate (GFR) \< 30 mL/min);
4. Medical conditions which could interfere with muscle function such as infections, trauma, fractures, or planned surgery;
5. Medical conditions that could affect hand functioning including but not limited to rheumatoid arthritis, Dupuytren's contracture, hand deformity, etc.;
6. Severe arthritis or medical condition (other thanDM1/DM2) that would significantly impact ambulation;
7. High incidence of falls or fall-associated fractures (\>5 falls during the past 12 months);
8. Preexisting elevated liver function tests \> 3 times the upper limit of normal (ULN) on Day 1 (alanine transaminase (ALT)/aspartate transaminase (AST), gamma-glutamyl transferase (GGT)) and/or any abnormal chemistry, hematology or urine lab considered clinically significant by investigator;
9. Serum potassium values \< 3.5 mmol/L or \> 5.0 mmol/L or serum magnesium values \< 1.7 mg/dL. Electrolytic imbalance such as hypokalaemia, hyperkalaemia or hypomagnesaemia may increase the proarrhythmic effects of mexiletine. Electrolyte imbalances need to be corrected before administering mexiletine and will be monitored throughout treatment.
10. Intake of any anti-myotonic treatment within 4 weeks prior to baseline (Day 1) or 5 half-lives, whichever is longer such as metformin, such as propafenone, flecainide, lamotrigine, carbamazepine or any other channel-blocker/ anticonvulsive drugs;
11. Use of any concomitant medications that could increase the cardiac risk;
12. Known allergy to mexiletine or any local anesthetics;
13. Participation in another interventional clinical study during the last 3 months or 5 half-lives of the investigational medicinal product, whichever is longer (with the exception of participation in the previous MEX-DM-302 study);
14. Wheelchair-bound or bed-ridden;
15. Any cardiac safety associated condition including any of the following criteria detected by cardiac evaluations including 24-hr Holter monitor, echocardiogram and clinical evaluations:
* PR interval ≥240 ms or QRS duration ≥120 ms on resting ECG
* Personal history of 3rd degree or 2nd degree type 2 atrioventricular block or sinus node dysfunction with pauses ≥3 seconds, complete bundle branch block, bifascicular and trifascicular block or any heart block susceptible to evolve to complete heart block
* Personal history of sustained atrial fibrillation, flutter or tachycardia (duration \>30 seconds)
* Personal history of non-sustained (ventricular triplets or more) or sustained ventricular tachycardia
* Myocardial infarction (acute or past) or coronary artery stenosis \>50%, presence of abnormal Q waves
* New York Heart Association (NYHA) Class II to IV heart failure
* Left ventricular systolic dysfunction with ejection fraction \<50%
* Sinus node dysfunction (including ECG sinus rate \<50 beats per minute (BPM))
* Co-administration of antiarrhythmics inducing torsades de pointes (class Ia: quinidine, procainamide, disopyramide, ajmaline; class Ic: encainide, flecainide, propafenone, moricizine; class III: amiodarone, sotalol, ibutilide, dofetilide, dronedarone, vernakalant)
* Co-administration of other classes of antiarrhythmics (class Ib: lidocaine, phenytoin, tocainide; class II: propranolol, esmolol, timolol, metoprolol, atenolol, carvedilol, bisoprolol, nebivolol; class IV: verapamil, diltiazem)
* Patients with implantable cardioverter defibrillators (ICDs) and pacemakers are excluded
* Presence of symptomatic coronary artery disease