
批處理安裝mysql如何截取生成的隨機密碼并保存便于后續調用在安裝mysql時,輸入mysqld --initialize --console后,會生成一個隨機密碼(最后12位),請問該如何截取這12位密碼并保存,后續調用?
nclick="copycode($('code0'));">復制代碼
- D:mysql-8.0.28-winx64mysql-8.0.28-winx64bin>mysqld --initialize --console
- -04-19T11:45:10.951279Z 0 [Warning] [MY-010918] [Server] 'default_authentication_plugin' is deprecated and will be removed in a future release. Please use authentication_policy instead.
- -04-19T11:45:10.951298Z 0 [System] [MY-013169] [Server] D:mysql-8.0.28-winx64mysql-8.0.28-winx64binmysqld.exe (mysqld 8.0.28) initializing of server in progress as process 14012
- -04-19T11:45:10.951379Z 0 [ERROR] [MY-010338] [Server] Can't find error-message file 'D:mysql-8.0.26-winx64mysql-8.0.26-winx64shareerrmsg.sys'. Check error-message file location and 'lc-messages-dir' configuration directive.
- -04-19T11:45:10.990057Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
- -04-19T11:45:11.514595Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
- -04-19T11:45:12.296844Z 0 [Warning] [MY-013829] [Server] Missing data directory for ICU regular expressions: D:mysql-8.0.26-winx64mysql-8.0.26-winx64libprivate.
- -04-19T11:45:13.580235Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: C6lGXsJfk,4D

