MySQL8.0 zip安装方法

下载Mysql 8.0 地址:MySQL :: Download MySQL Installer

1、解压到对应的文件夹 D:\soft\Mysql8.0\mysql-8.0.26-winx64

2、创建my.ini 和data文件夹, 需要修改的是basedir和datadir 必须是\\

[mysqld]
default_authentication_plugin=mysql_native_password
# 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:\\soft\\Mysql8.0\\mysql-8.0.26-winx64
datadir=D:\\soft\\Mysql8.0\\mysql-8.0.26-winx64\\data
port = 3306
# 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

3、初始化数据库,进入到bin目录下

 .\mysqld --initialize --console

 执行完成后,会打印 root 用户的初始默认密码,我们需要记住初始密码。

4、安装mysql服务

bin目录下

.\mysqld --install [服务名] 

5、启动mysql 服务

目录C:\Windows\System32下 执行命令

 .\net start mysql

6、进入mysql,修改密码 

我们输入:

.\mysql -uroot -p
这时候会提示输入密码,前面记住的密码,填入即可登录成功,进入MySQL命令模式。

在MySQL中执行命令:

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';(注意一定要有分号,这里的password是你设置的密码)

FLUSH PRIVILEGES; 

修改密码验证插件,同时修改密码。

之后使用root ,3306端口,localhost,就可以登录MySQL了。

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值