MySql 8.0 starts and stops after my.ini saved or edited in Windows 10
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?
Solution 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.