Window安装解压版本mysql5.7

1、	获取mysql-5.7.34-winx64.zip,解压到F:\kindoapp
2、	在F:\kindoapp\mysql-5.7.34-winx64目录中创建my.ini并写入下面内容:
[mysql]
# 设置mysql客户端默认字符集
default-character-set=utf8mb4
[mysqld]
#设置端口
port = 3206
basedir=F:\kindoapp\mysql-5.7.34-winx64
datadir=F:\kindoapp\mysql-5.7.34-winx64\data
max_connections=200
# 服务端使用的字符集默认为8比特编码的latin1字符集
character-set-server=utf8mb4
# 创建新表时将使用的默认存储引擎
default-storage-engine=INNODB

max_connections = 800
max_connect_errors = 1000
max_allowed_packet = 1000M

innodb_file_per_table = 1
innodb_log_file_size=148M
innodb_page_size=32k

#skip-grant-tables 加这个参数关闭登录密码验证
3、以管理员身份运行cmd,依次执行下面命令
F:
cd F:\kindoapp\mysql-5.7.34-winx64\bin
.\mysqld.exe --initialize --console
.\mysqld.exe --initialize-insecure --user=mysql   #初始为空密码
如果出现:
由于找不到MSVCR120.dll,无法继续执行代码.重新安装程序可能会解决此问题

需要下载安装 Visual C++ Redistributable Packages for Visual Studio 2013 x64

mysqld: Could not create or access the registry key needed for the MySQL application
to log to the Windows EventLog. Run the application with sufficient
privileges once to create the key, add the key manually, or turn off
logging for that application.
需要以管理员运行
到data目录查看.err文件,修复出现的错误,此文件中包括了root密码:
A temporary password is generated for root@localhost: h,go6w0oKche

.\mysqld.exe -install mysql57
net start mysql57
启动有问题,删除服务解决问题再重新安装
.\mysqld.exe -remove mysql57

4、	登录mysql
.\mysql --port 3206 -uroot -p
修改密码:
alter user 'root'@'localhost' identified by '123456';
grant all privileges on *.* to 'root'@'%' identified by '123456';
flush privileges;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

shibushi114

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值