mysql-8.0.21安装

安装文件

  1. 登录mysql官网
    https://dev.mysql.com/downloads/workbench/
    选择GA版本
    在这里插入图片描述
  2. 点击“不用了,请直接下载”,可直接开始下载
    在这里插入图片描述
  3. 下载成功,得到压缩包mysql-8.0.21-winx64.zip。

mysql-8.0.21安装配置

  1. 解压,添加系统变量路径,选择“Path”->“编辑”
    在这里插入图片描述
  2. 点击“新建”,输入加压后mysql8的bin目录路径,
    在这里插入图片描述
  3. 在解压后的mysql-8.0.21-winx64目录下(与bin目录同一级),新建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.
basedir = E:\mysql-8.0.21-winx64
datadir = E:\mysql-8.0.21-winx64\data
port = 3306
max_connections = 200
max_connect_errors=10
character-set-server=utf8
default-storage-engine=INNODB
default_authentication_plugin=mysql_native_password
# 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 

[mysql]
default-character-set=utf8

[client]
port=3306
default-character-set=utf8
  1. 以管理员身份运行cmd.exe,导航到mysql8的bin目录下
    在这里插入图片描述
  2. 安装mysql,执行命令
mysqld --install mysql

在这里插入图片描述
6. mysql初始化,生成data目录,执行命令

mysqld --initialize --console

在这里插入图片描述
初始密码,如果不小心关掉了密码没保存那就删掉data目录重新初始化。
7. 开启服务,执行命令

net start mysql

在这里插入图片描述
8. 登录,执行命令

mysql -u root -p

提示输入密码,输入root初始密码
在这里插入图片描述
9. 修改密码,输入mysql命令

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

在这里插入图片描述
安装完毕。

  • 2
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值