2.3.5 Troubleshooting a Microsoft Windows MySQL Server InstallationMicrosoft Windows MySQL Server安装疑难解答

When installing and running MySQL for the first time, you may encounter certain errors that prevent the MySQL server from starting. This section helps you diagnose and correct some of these errors.第一次安装和运行MySQL时,可能会遇到某些错误,导致MySQL服务器无法启动。本节帮助您诊断和更正其中的一些错误。

Your first resource when troubleshooting server issues is the error log. 解决服务器问题时的第一个资源是错误日志The MySQL server uses the error log to record information relevant to the error that prevents the server from starting. MySQL服务器使用错误日志来记录与阻止服务器启动的错误相关的信息。The error log is located in the data directory specified in your my.ini file. 错误日志位于my.ini文件中指定的数据目录中The default data directory location is C:\Program Files\MySQL\MySQL Server 8.0\data, or C:\ProgramData\Mysql on Windows 7 and Windows Server 2008. 默认的数据目录位置是C:\Program Files\MySQL\MySQL Server 8.0\data,或Windows 7和Windows Server 2008上的C:\ProgramData\MySQLThe C:\ProgramData directory is hidden by default. 默认情况下,C:\ProgramData目录是隐藏的。You need to change your folder options to see the directory and contents. 您需要更改文件夹选项才能查看目录和内容。For more information on the error log and understanding the content, see Section 5.4.2, “The Error Log”.有关错误日志和理解内容的更多信息,请参阅第5.4.2节,“错误日志”

For information regarding possible errors, also consult the console messages displayed when the MySQL service is starting. 有关可能的错误的信息,请参阅MySQL服务启动时显示的控制台消息。Use the SC START mysqld_service_name or NET START mysqld_service_name command from the command line after installing mysqld as a service to see any error messages regarding the starting of the MySQL server as a service. 在将mysqld作为服务安装后,从命令行使用SC START mysqld_service_nameNET START mysqld_services_name命令,查看有关将MySQL服务器作为服务启动的任何错误消息。See Section 2.3.4.8, “Starting MySQL as a Windows Service”.请参阅第2.3.4.8节,“将MySQL作为Windows服务启动”

The following examples show other common error messages you might encounter when installing MySQL and starting the server for the first time:以下示例显示了在安装MySQL和首次启动服务器时可能遇到的其他常见错误消息: