首先呢,下载前需要确认自己的电脑系统版本,我这里是64位的,就以自己的为准了
需要登陆MySQL :: Download MySQL Community Server
去下载mysql然后配置环境变量
添加MYSQL_HOME? D:\mysql-5.7.44-winx64
编辑 path 变量? ? ?添加? ?%MYSQL_HOME%\bin
环境变量配置以后然后以cmd命令用管理员的身份打开,打开之后设置一下用户名和密码就可以了
如下所示加粗的就是命令
C:\Windows\system32>mysql -u root -p
Enter password:
Welcome to the MySQL monitor. ?Commands end with ; or \g.
Your MySQL connection id is 6
Server version: 5.7.44 MySQL Community Server (GPL)
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 '123456';
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH PRIVILEGES; exit;
Query OK, 0 rows affected (0.00 sec)
Bye