1.下载安装包(bin)
https://downloads.mysql.com/archives/community/
2.
bin同级目录下建立data目录,新建my.ini文件 更改ini文件里面的地址
[mysqld]
port=3306
basedir=C:\d\environment\mysql\mysql-8.0.31-winx64
datadir=C:\d\environment\mysql\mysql-8.0.31-winx64\Data
max_connections=200
max_connect_errors=10
character-set-server=utf8mb4
default-storage-engine=INNODB
default_authentication_plugin=mysql_native_password
[mysql]
default-character-set=utf8mb4
[client]
port=3306
default-character-set=utf8mb4
3.
在没有配置环境变量之前(bin) mysql.exe -uroot -p 是不生效的
mysqld --initialize --console
mysqld --install
net start mysql
#改密码
ALTER USER USER() IDENTIFIED BY 'Admin2022!';
flush privileges;
net stop mysql
.\mysql.exe --install
.\mysql.exe
.\mysql.exe -uroot -p