MySql 8.0 starts and stops after my.ini saved or edited in Windows 10

5

1

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?

jhersey29

Posted 2019-04-03T18:40:28.980

Reputation: 221

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 – 2019-04-04T13:03:21.990

Answers

7

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.

jhersey29

Posted 2019-04-03T18:40:28.980

Reputation: 221

Yeah! I must save my.ini as ANSI Encoding, if not mysql server couldn't start – HelloWindowsPhone – 2019-05-06T04:46:44.847

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. – Maxim Gershkovich – 2020-02-12T04:41:24.567