D:\mysql-8.0.33-winx64\bin>mysqld --initialize --console
2023-05-25T07:23:15.531019Z 0 [Warning] [MY-010918] [Server] ‘default_authentication_plugin’ is deprecated and will be removed in a future release. Please use authentication_policy instead.
2023-05-25T07:23:15.531048Z 0 [System] [MY-013169] [Server] D:\mysql-8.0.33-winx64\bin\mysqld.exe (mysqld 8.0.33) initializing of server in progress as process 3052
2023-05-25T07:23:15.709725Z 0 [ERROR] [MY-010457] [Server] --initialize specified but the data directory has files in it. Aborting.
2023-05-25T07:23:15.709741Z 0 [ERROR] [MY-013236] [Server] The designated data directory D:\mysql-8.0.33-winx64\data\ is unusable. You can remove all files that the server added to it.
2023-05-25T07:23:15.710764Z 0 [ERROR] [MY-010119] [Server] Aborting
2023-05-25T07:23:15.711048Z 0 [System] [MY-010910] [Server] D:\mysql-8.0.33-winx64\bin\mysqld.exe: Shutdown complete (mysqld 8.0.33) MySQL Community Server - GPL.
D:\mysql-8.0.33-winx64\bin>mysqld -remove
The service doesn’t exist!
D:\mysql-8.0.33-winx64\bin>mysqld --install mysql
Service successfully installed.
D:\mysql-8.0.33-winx64\bin>net start mysql
mysql 服务正在启动 …
mysql 服务已经启动成功。
D:\mysql-8.0.33-winx64\bin>mysqladmin -uroot -p654321 password 654564654!@# 通过mysqladmin工具修改mysql密码
mysqladmin: [Warning] Using a password on the command line interface can be insecure.
Warning: Since password will be sent to server in plain text, use ssl connection to ensure password safety.
D:\mysql-8.0.33-winx64\bin>mysql -uroot -p
Enter password: *************
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 16
Server version: 8.0.33 MySQL Community Server - GPL
Copyright © 2000, 2023, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.