MySQL安装

下载MySQL绿色版

去官方下载mysql。,我下载的是 mysql-5.6.27-winx64,下载后解压缩到D:盘。

安装MySQL服务

  • 拷贝my-default.ini重命名为my.ini,修改内容。
# 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.
#mysql根目录
 basedir ="D:/mysql-5.6.27-winx64"
#数据文件存放目录
 datadir ="D:/mysql-5.6.27-winx64/data"
# port = .....   端口,默认3306
# server_id = .....  服务实例的唯一标识

#设置数据库引擎为INNODB
default-storage-engine=INNODB


# 设置mysql服务器编码
character_set_server=utf8

# 设置mysql服务器字符集
collation-server=utf8_general_ci
# port = 3306
# server_id = 1

[client]
default-character-set = utf8

[WinMySQLAdmin]
Server = "D:\mysql-5.6.27-winx64\bin\mysqladmin.exe"

执行 mysqld安装,再执行 net start MySQL5服务。

MySQL安装_第1张图片

修改mysl用户名密码

MySQL安装_第2张图片
如上,数据库登陆成功。

你可能感兴趣的:(MySQL安装)