Windows7 64位压缩包安装MySQL5.7.9
2023-03-07 09:42:29 时间
官网下载64bit MySQL5.7.9压缩包, 解压至安装位置
1. 创建 my.ini 文件 from my-default.ini, 内容如下
[mysqld] # Remove leading # and set to the amount of RAM for the most important data # cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%. innodb_buffer_pool_size = 128M # Remove leading # to turn on a very important data integrity option: logging # changes to the binary log between backups. # log_bin # These are commonly set, remove the # and set as required. basedir=C:/webserver/mysql datadir=C:/webserver/mysql/data port=6033 # server_id = ..... # 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 bulk_insert_buffer_size = 16M innodb_flush_log_at_trx_commit = 0 sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
2. 初始化数据库(not need for mysql5.6, the password for root is empty)
path-to-mysql\bin\mysqld.exe --initialize
生成的root密码在data目录下的.err文件中能找到, 注意密码包含符号, 如果最后一个是" 或者), 不要漏掉
Win7 may show error msvcp100.dll and msvcr100.dll are missing, download them from https://www.dll-files.com/ (64bit version), and place them into C:\Windows\System32
3. 第一次启动
path-to-mysql\bin\mysqld.exe --console 或者 path-to-mysql\bin\mysqld.exe --log-error 或者 path-to-mysql\bin\mysqld.exe --standalone
客户端连接, 执行
path-to-mysql\bin\mysql -P 6033 -u root -p # 指定编码的连接 path-to-mysql\bin\mysql.exe -P 6033 -u root -p --default-character-set=utf8
第一次登入时, 会要求你必须修改密码
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
修改下密码就可以了
mysql> SET PASSWORD = PASSWORD('root');
停止MySQL, 要新开命令行窗口, 执行
path-to-mysql\bin\mysqladmin.exe -P 6033 -u root -p shutdown
4. 安装为windows服务
path-to-mysql\bin\mysqld.exe --install MySQL --defaults-file=path-to-it\mysql\my.ini #移除服务 path-to-mysql\bin\mysqld.exe --remove
5. 启动/停止服务
net start mysql
net stop mysql
附win7下的各服务启动/关闭脚本, 保存为.bat, 运行时必须以管理员身份
@echo off net stop memcached net stop MySQL net stop Apache2.4 net start memcached net start Apache2.4 net start MySQL pause
相关文章
- 在 Go 里用 CGO?这 7 个问题你要关注!
- 9款优秀的去中心化通讯软件 Matrix 的客户端
- 求职数据分析,项目经验该怎么写
- 在OKR中,我看到了数据驱动业务的未来
- 火山引擎云原生大数据在金融行业的实践
- OpenHarmony富设备移植指南(二)—从postmarketOS获取移植资源
- 《数据成熟度指数》报告:64%的企业领袖认为大多数员工“不懂数据”
- OpenHarmony 小型系统兼容性测试指南
- 肯睿中国(Cloudera):2023年企业数字战略三大趋势预测
- 适用于 Linux 的十大命令行游戏
- GNOME 截图工具的新旧截图方式
- System76 即将推出的 COSMIC 桌面正在酝酿大变化
- 2GB 内存 8GB 存储即可流畅运行,Windows 11 极致精简版系统 Tiny11 发布
- 迎接 ecode:一个即将推出的具有全新图形用户界面框架的现代、轻量级代码编辑器
- loongarch架构介绍(三)—地址翻译
- Go 语言怎么解决编译器错误“err is shadowed during return”?
- 敏捷:可能被开发人员遗忘的部分
- Denodo预测2023年数据管理和分析的未来
- 利用数据推动可持续发展
- 在 Vue3 中实现 React 原生 Hooks(useState、useEffect),深入理解 React Hooks 的