After installing MySQL 8.0 I made some changes to the my.ini file and the service failed to start. I reverted the changes and MySQL 8.0 would still not start. I then uninstalled and reinstalled. MySQL started with the new install. This time I decided to make a backup of the MySQL file and then simply open the my.ini file in notepad, make no changes and just save the file. MySQL 8.0 would again start and then immediately stop with out logging errors.

I then renamed the unedited my.ini file with no changes to my.ini.bad and renamed the my.ini copy to my.ini and MySQL would start again.

I compared the differences in the files and see nothing different on the file permissions.

I can't seem to edit the file at all. Any save even without changing the file prevents MySQL from running.

Notepad is changing the filesize from 17464 to 17467 with out any editing.

How do I edit the my.ini file and also have MySQL start?

  • On a second check the files sizes are a little different. Originally I was using the Size column in File Explorer. Using the details in the file properties the file is originally 17464 bytes. After saving it in Notepad with no changes the file size is 17467.
    – jhersey29
    Apr 4, 2019 at 13:03

1 Answer 1


I found the ini file from mySQL has 3 invalid ANSI characters. The following line in the file is the culprit "The line # range from 1 to 2^32 − 1. “Unique” means that each ID must be different.". It has 3 Unicode characters. This is causing notepad to append the byte order mark to the text file.

Remove this comment and use Save As in Notepad. Under "Save As" change encoding to ANSI. If you don't remove the comment and then save as ANSI, Notepad will automatically replace the characters with place holders.

  • 1
    Yeah! I must save my.ini as ANSI Encoding, if not mysql server couldn't start May 6, 2019 at 4:46
  • 1
    Thank you so much, this was my problem, I couldnt get the my.ini file to work no matter what I tried. This resolved the issue. Feb 12, 2020 at 4:41
  • hero of the month award
    – Smith
    Mar 2 at 17:02

Not the answer you're looking for? Browse other questions tagged or ask your own question.