mysql 8 windows 下安装

1.下载 mysql8

需要下载 window的 zip版本

2.解压

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

mysql 8 windows 下安装

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

mysql 8 windows 下安装

记住这个密码

4.安装mysql 服务

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

启动服务 net start mysql8

5.修改初始密码

mysql -uroot -p 输入密码登录

修改初始密码

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

上一篇:LeetCode算法题-Min Cost Climbing Stairs(Java实现)


下一篇:Javaweb学习笔记——(十八)——————事务、DBCP、C3P0、装饰者模式