2023-06-01T15:28:11.186220Z 0 [Warning] [MY-010918] [Server] 'default_authentication_plugin' is deprecated and will be removed in a future release. Please use authentication_policy instead. 2023-06-01T15:28:11.186238Z 0 [System] [MY-013169] [Server] D:\mysql\bin\mysqld.exe (mysqld 8.0.28) initializing of server in progress as process 5588 2023-06-01T15:28:11.188281Z 0 [ERROR] [MY-010457] [Server] --initialize specified but the data directory has files in it. Aborting. 2023-06-01T15:28:11.188293Z 0 [ERROR] [MY-013236] [Server] The designated data directory D:\mysql\data\ is unusable. You can remove all files that the server added to it. 2023-06-01T15:28:11.188754Z 0 [ERROR] [MY-010119] [Server] Aborting 2023-06-01T15:28:11.188988Z 0 [System] [MY-010910] [Server] D:\mysql\bin\mysqld.exe: Shutdown complete (mysqld 8.0.28) MySQL Community Server - GPL.
时间: 2023-12-16 12:04:51 浏览: 39
这是一个MySQL数据库服务器初始化的错误日志,其中包含了以下几个信息:
1. 警告信息:'default_authentication_plugin' 已经过时,将在将来的版本中被移除,应该使用 authentication_policy 替代它。
2. 系统信息:MySQL服务器正在初始化过程中。
3. 错误信息:--initialize 被指定,但是数据目录中已经有文件存在,因此初始化被终止。
4. 错误信息:指定的数据目录不可用,建议删除所有服务器添加的文件。
5. 错误信息:MySQL服务器终止运行。
这个错误日志可能是由于在数据目录中已经存在文件,导致服务器初始化失败。建议删除数据目录中的所有文件,重新初始化服务器。
相关问题
2023-07-09T01:41:41.589150Z 0 [Warning] [MY-010918] [Server] 'default_authentication_plugin' is deprecated and will be removed in a future release. Please use authentication_policy instead.
这是关于MySQL的一个警告信息,它表示"default_authentication_plugin"将在未来的版本中被移除,并建议使用"authentication_policy"来代替。这意味着在将来的版本中,你需要更新你的代码或配置,以使用新的身份验证策略。这是MySQL团队为了改进和提升安全性而进行的变更之一。你可以查看MySQL的官方文档或寻求相关的技术支持来获取更多关于这个变更的详细信息。
root@DESKTOP-0CU081I:/# sudo mysqld --default_authentication_plugin=mysql_native_password mysqld: [Warning] World-writable config file '/etc/mysql/my.cnf' is ignored. 2023-06-05T10:01:47.364773Z 0 [Warning] [MY-010918] [Server] 'default_authentication_plugin' is deprecated and will be removed in a future release. Please use authentication_policy instead. 2023-06-05T10:01:47.364802Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.33-0ubuntu0.20.04.2) starting as process 392 2023-06-05T10:01:47.366321Z 0 [ERROR] [MY-010123] [Server] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root! 2023-06-05T10:01:47.366408Z 0 [ERROR] [MY-010119] [Server] Aborting 2023-06-05T10:01:47.366507Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.33-0ubuntu0.20.04.2) (Ubuntu).
在上述命令中,出现了以下几个问题:
1. `default_authentication_plugin` 已经被标记为过时的参数,将来会被移除,应该使用 `authentication_policy` 参数来替代。
2. 该命令使用了 `sudo` 来以 root 权限运行 `mysqld`,但是 MySQL 官方强烈建议不要使用 root 用户来运行 `mysqld`。
3. 出现了一个致命错误,提示需要阅读 MySQL 手册中的 "Security" 部分来了解如何以 root 用户身份运行 `mysqld`。
因此,建议使用以下命令来启动 `mysqld`:
```
sudo systemctl start mysql
```
这将使用 MySQL 8.0 的默认配置启动 MySQL 服务。如果你需要指定 `authentication_policy` 参数,可以在 MySQL 配置文件中进行设置,例如在 `/etc/mysql/mysql.conf.d/mysqld.cnf` 文件中添加以下内容:
```
[mysqld]
authentication_policy = mysql_native_password
```
然后重新启动 MySQL 服务:
```
sudo systemctl restart mysql
```
这样就可以使用 `mysql_native_password` 认证插件来运行 MySQL 了。