mysql 8 windows 下安装

Posted yg_zhang

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mysql 8 windows 下安装相关的知识,希望对你有一定的参考价值。

1.下载 mysql8

需要下载 window的 zip版本

2.解压

D:\\software\\mysql\\mysql-8.0.16-winx64

技术图片

 

2.在这个目录下创建一个 my.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 = D:/software/mysql/mysql-8.0.16-winx64
datadir = D:/software/mysql/mysql-8.0.16-winx64/data
port = 3308
# 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 

character-set-server = utf8mb4

performance_schema_max_table_instances = 600
table_definition_cache = 400
table_open_cache = 256

[mysql]
default-character-set = utf8mb4

[client]
default-character-set = utf8mb4

注意修改 basedir,datadir 两个目录。

3.执行初始化

mysqld --initialize --console

技术图片

记住这个密码

 

4.安装mysql 服务

这个需要在超管的身份下执行 mysqld --install  mysql8

启动服务 net start mysql8

5.修改初始密码

mysql -uroot -p 输入密码登录

修改初始密码

ALTER USER ‘root‘@‘localhost‘ IDENTIFIED WITH mysql_native_password BY ‘root‘;

 

以上是关于mysql 8 windows 下安装的主要内容,如果未能解决你的问题,请参考以下文章

windows下mysql 8.0.12安装步骤及基本使用教程

MySQL 8.0.12 基于Windows 安装教程

windows下Mysql安装及启动

windows平台下mysql 8.0 免安装版配置步骤

MySQL 8.0.12 基于Windows 安装教程

Windows下安装MySQL