[mysqld] # set basedir to your installation path basedir=C:/mysql # set datadir to the location of your data directory datadir=C:/mysql/data
> cd C:\mysql\bin > mysqld --initialize --console
2020-04-29T02:24:19.870696Z 0 [System] [MY-013169] [Server] c:\mysql\bin\mysqld.exe (mysqld 8.0.20) initializing of server in progress as process 9100 2020-04-29T02:24:19.885207Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started. 2020-04-29T02:24:20.948293Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended. 2020-04-29T02:24:23.220643Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: 3yWmcM,UdJ&M
mysqld --console
c:\mysql\bin>mysql -u root -p Enter password: ************(さっきのパスワード) Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 10 Server version: 8.0.20 Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. 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. mysql>
mysql> ALTER USER `root`@`localhost` IDENTIFIED BY 'new_password', `root`@`localhost` PASSWORD EXPIRE NEVER;