1.从服务器下载最新的版本
https://downloads.mysql.com/archives/community/
2.解压到本地文件
3.配置系统变量 MYSQL_HOME 值是本地的地址D:\Program\mysql-8.0.30-winx64
在Path环境变量中添加 %MYSQL_HOME%\bin
4.创建my.ini[mysql]# 设置mysql客户端默认字符集default-character-set=utf8
[mysqld] port = 3306
basedir=D:\Program\mysql-8.0.30-winx64 datadir=D:\Program\mysql-8.0.30-winx64\data max_connections=50 character-set-server=utf8 default-storage-engine=INNODB # Remove leading # to set options mainly useful for reporting servers. # The server defaults are faster for transactions and fast SELECTs. # Adjust sizes as needed, experiment to find the optimal values. # join_buffer_size = 128M # sort_buffer_size = 2M # read_rnd_buffer_size = 2M sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES #sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
5.打开cmd命令窗口,然后使用管理员权限重新打开命令窗口执行mysqld --initialize --console
这里出现的是roor的初始化密码,这个要存下来登录的时候需要用到,但是我本地执行未出现,报错问题。不出现也无所谓,直接修改密码
6.继续执行mysqld --initialize--insecure 回车后再次执行mysqld --initialize
7.执行到这里已经生成了服务MYSQL
在程序中运行net start mysql即可运行
8.在命令窗口输入mysql -u root -p 输入密码即可登录
标签:NO,windows,Mysql,--,mysqld,本地,mysql,winx64,搭建 From: https://www.cnblogs.com/wangjunguang/p/16990343.html