一. 官网下载最新版本的mysql
https://dev.mysql.com/downloads/mysql/

不用注册登录直接下载 mysql-8.0.27-win64.zip

二 安装
2.1 解压安装包
这里解压到E:\soft\mysql-8.0.27-winx64目录下

2.2 以管理员员身份运行命令行

2.3 初始化
在E:\soft\mysql-8.0.27-winx64 目录下创建data文件夹
运行命令 mysqld --initialize --user=mysql --console
牢记初始密码

2.4 添加服务
添加服务命令 mysqld -install
移除服务命令 mysqld -remove mysql


2.4 启动服务
net start mysql
停止服务net stop mysql
也可以直接通过系统服务窗口去操作

2.5 连接mysql服务
用root用户连接服务,密码为2.3中的初始化密码
修改初始密码
ALTER USER root@localhost IDENTIFIED BY 'velpro33';
设置远程可连接访问
use mysql;
update user set host = '%' where user = 'root';
flush privileges;

至此mysql已经安装成功
可以使用图形工具连接操作

三 其他
1.关于"由于找不到VCRUNTIME140.dll,无法继续执行代码' 的问题,是由于系统确认vc运行库
https://docs.microsoft.com/zh-CN/cpp/windows/latest-supported-vc-redist?view=msvc-170
下载根据自己系统版本下载,这里下载64位的
https://aka.ms/vs/17/release/vc_redist.x64.exe 安装完重启系统即可

网友评论