我在Windows8.0上运行MySQL。我对my.ini做了一些修改(最终找到了它!)更改字符集。愚蠢的是,我没有先备份它,我使用的是记事本,它没有多次撤销。
现在我得到了
The MySQL Service could not be started
The service did not report an errorMYSQL日志中也没有记录错误。
我肯定我不小心删掉了一行重要的东西,但是我怎么也找不到它。这是我更改过的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。我已经检查了权限--看起来一切正常。
发布于 2019-05-02 20:14:54
我找到了答案。这个问题根本不是因为我的更改,而是因为我在记事本中更改了它。当我在Notepad++中打开文件检查编码时,我注意到编码是UTF-8-BOM。
我将其更改为普通的UTF-8,MySQL现在启动。我不确定是记事本改变了它,或者只是没有正确地编码UTF-8-BOM,但主要的事情是它启动了。
发布于 2021-08-30 14:30:07
将文件保存到ANSI将解决此问题。
https://stackoverflow.com/questions/55950587
复制相似问题