我在 Windows 上运行 MySQL 8.0。我对 my.ini 做了一些更改(最终找到了它!)以更改字符集。愚蠢的是我没有先备份它,并且我使用了记事本,它没有多重撤消功能。
现在我明白了
The MySQL Service could not be started
The service did not report an error
MYSQL 日志中也没有记录任何错误。
我确定我不小心删除了重要的一行或其他内容,但我一生都找不到它。这是我更改的 my.ini 部分:
[client]
# pipe=
# socket=MYSQL
port=3306
[mysql]
# SERVER SECTION
# ----------------------------------------------------------------------
#
# 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
[mysqld]
# 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
port=3306
# 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
character-set-server=utf8
我尝试撤消我所做的事情(尽管正如我所说,我可能不小心更改了其他内容),并在尝试重新启动之前使用 mysqld --initialize 。我检查了权限 - 一切似乎都正常。
我找到了答案。问题根本与我的更改无关,而是因为我在记事本中更改了它。当我在Notepad++中打开文件检查编码时,我注意到编码是UTF-8-BOM。
我将其更改为纯 UTF-8,MySQL 现在启动。我不确定记事本是否改变了它,或者只是没有正确编码 UTF-8-BOM,但最主要的是它启动了。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)