C:\Users\...\Downloads\mysql-8.0.27-winx64\bin>mysqld -remove mysql Service successfully removed.
C:\Users\...\Downloads\mysql-8.0.27-winx64\bin>mysqld --initialize --user=mysql --console 2022-03-01T09:53:39.820016Z 0 [System] [MY-013169] [Server] C:\Users\eshibij\Downloads\mysql-8.0.27-winx64\bin\mysqld.exe (mysqld 8.0.27) initializing of server in progress as process 26856 2022-03-01T09:53:39.823462Z 0 [ERROR] [MY-010457] [Server] --initialize specified but the data directory has files in it. Aborting. 2022-03-01T09:53:39.823476Z 0 [ERROR] [MY-013236] [Server] The designated data directory C:\Users\eshibij\Downloads\mysql-8.0.27-winx64\data\ is unusable. You can remove all files that the server added to it. 2022-03-01T09:53:39.848518Z 0 [ERROR] [MY-010119] [Server] Aborting 2022-03-01T09:53:39.852182Z 0 [System] [MY-010910] [Server] C:\Users\eshibij\Downloads\mysql-8.0.27-winx64\bin\mysqld.exe: Shutdown complete (mysqld 8.0.27) MySQL Community Server - GPL. # here initialize user failed due to the last existing `/data` folder, remind to delete it before you redo the init
C:\Users\...\Downloads\mysql-8.0.27-winx64\bin>mysqld --initialize --user=mysql --console 2022-03-01T09:54:04.045122Z 0 [System] [MY-013169] [Server] C:\Users\eshibij\Downloads\mysql-8.0.27-winx64\bin\mysqld.exe (mysqld 8.0.27) initializing of server in progress as process 11404 2022-03-01T09:54:04.106350Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started. 2022-03-01T09:54:06.283703Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended. 2022-03-01T09:54:08.851696Z 0 [Warning] [MY-013746] [Server] A deprecated TLS version TLSv1 is enabled for channel mysql_main 2022-03-01T09:54:08.856307Z 0 [Warning] [MY-013746] [Server] A deprecated TLS version TLSv1.1 is enabled for channel mysql_main 2022-03-01T09:54:09.029924Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: D(ag!*brW6w5
C:\Users\...\Downloads\mysql-8.0.27-winx64\bin>mysqld -install Service successfully installed.
C:\Users\...\Downloads\mysql-8.0.27-winx64\bin>net start mysql The MySQL service is starting. The MySQL service was started successfully.
C:\Users\...\Downloads\mysql-8.0.27-winx64\bin>mysql -u root -p Enter password: ************ Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 8 Server version: 8.0.27
Copyright (c) 2000, 2021, 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'forhelp. Type '\c' to clear the current input statement.
mysql> use mysql No connection. Trying to reconnect... Enter password: ************ Connection id: 9 Current database: *** NONE ***
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement. # need to change the default password first
mysql> ALTER USER root@localhost IDENTIFIED BY 'root'; Query OK, 0 rows affected (0.01 sec)