[SOLVED] MySQL service could not be started after changing my.ini


I have MySQL 8.0 running on Windows. I made some changes to my.ini (having eventually found it!) to change the character set. Stupidly I did not back it up first, and I used Notepad, which doesn’t have multiple undo.

Now I get

 The MySQL Service could not be started

 The service did not report an error

There are no errors logged in the MYSQL log either.

I’m sure I’ve accidentally deleted an important line or something, but can’t for the life of me find it. This is the section of my.ini that I changed:


# pipe=

# socket=MYSQL



# ----------------------------------------------------------------------
# The following options will be read by the MySQL Server. Make sure that
# you have installed the server correctly (see above) so it reads this 
# file.
# server_type=2

# The next three options are mutually exclusive to SERVER_PORT below.
# skip-networking
# enable-named-pipe
# shared-memory

# shared-memory-base-name=MYSQL

# The Pipe the MySQL Server will use
# socket=MYSQL

# The TCP/IP Port the MySQL Server will listen on

# Path to installation directory. All paths are usually resolved relative to this.
# basedir="C:/Program Files/MySQL/MySQL Server 8.0/"

# Path to the database root
datadir=C:/ProgramData/MySQL/MySQL Server 8.0/Data

# The default character set that will be used when a new schema or table is
# created and no character set is defined

I’ve tried undoing what I did (though as I say, I may have accidentally changed something else), and using mysqld –initialize before trying to restart. I’ve checked permissions – all seem to be OK.


I found the answer. The problem wasn’t to do with my changes at all, but because I had changed it in Notepad. When I opened the file in Notepad++ to check encoding, I noticed that the encoding was UTF-8-BOM.

I changed it to plain UTF-8 and MySQL now starts. I’m not sure if Notepad changed it, or just didn’t encode the UTF-8-BOM correctly, but the main thing is that it starts.

Answered By – Lucy

Answer Checked By – Mildred Charles (BugsFixing Admin)

Leave a Reply

Your email address will not be published. Required fields are marked *