mysql 8.0.33-win64安装

komore / 2023-05-06 / 原文

mysql 8.0.33下载链接

环境变量path中添加(注意自己的解压目录):D:\mysql-8.0.33-winx64\bin

C:\Windows\System32>mysqld --initialize --console
2023-05-05T15:19:16.956795Z 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 1564
2023-05-05T15:19:16.974942Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2023-05-05T15:19:17.382403Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2023-05-05T15:19:18.055609Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: mn03llrnf7+N

C:\Windows\System32>net start mysql
mysql 服务正在启动 .
mysql 服务已经启动成功。


C:\Windows\System32>mysqladmin -u root -h localhost password 'root';
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'

C:\Windows\System32>mysql -uroot -p
Enter password: ************
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 8.0.33

Copyright (c) 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.

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'root' REPLACE 'mn03llrnf7+N';
Query OK, 0 rows affected (0.01 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

mysql>

设置开机自启动

C:\Windows\System32>sc config mysql start= AUTO
[SC] ChangeServiceConfig 成功