前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >windows安装mysql示例

windows安装mysql示例

作者头像
编程随笔
发布2019-09-11 15:30:48
1.3K0
发布2019-09-11 15:30:48
举报
文章被收录于专栏:后端开发随笔后端开发随笔

1. 下载mysql安装包,如: mysql-5.6.34-winx64.zip 2. 解压安装包到指定目录,如:D盘,即:D:\mysql-5.6.34-winx64 3. 配置

代码语言:javascript
复制
cd D:\mysql-5.6.34-winx64
cp my-default.ini my.ini # windows下mysql配置文件名称为: my.ini
vim my.ini

my.ini配置示例:

代码语言:javascript
复制
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL.

[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 = D:\\mysql-5.6.34-winx64
datadir = D:\\mysql-5.6.34-winx64\\data # 当数据目录不在安装目录下时,需要先将mysql默认数据目录下的内容拷贝到相应目录,并明确配置该参数
# port = .....
# 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 

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 

详见mysql5.6安装示例:https://dev.mysql.com/doc/refman/5.6/en/windows-install-archive.html

4.启动 在windows控制台,执行:D:\mysql-5.6.34-winx64\bin\mysqld --console 即可启动mysql服务。

5.停止

在windows控制台,执行:D:\mysql-5.6.34-winx64\bin\mysqladmin -uroot shutdown 停止mysql服务,

不同版本的MySQL在安装时存在一些细微的差别,例如:从5.7版本开始默认不会在安装路径下自带data目录,详细步骤请参考官方文档:https://dev.mysql.com/doc/

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2017-01-24 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
云数据库 SQL Server
腾讯云数据库 SQL Server (TencentDB for SQL Server)是业界最常用的商用数据库之一,对基于 Windows 架构的应用程序具有完美的支持。TencentDB for SQL Server 拥有微软正版授权,可持续为用户提供最新的功能,避免未授权使用软件的风险。具有即开即用、稳定可靠、安全运行、弹性扩缩等特点。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档