mysql-8.0.17-winx64 免安装版本 初始化

一、官网下载mysql版本

       下载地址:https://dev.mysql.com/downloads/mysql

二、解压下载的mysqlzip压缩包至本地电脑

三、在解压的文件夹下新建data目录

四、执行初始化命令

进入mysql 的bin目录下  执行 初始化命令    mysqld --initialize --user=mysql --console 

初始化后根密码分配

通过使用--initialize或 --initialize-insecure启动服务器初始化数据目录后,正常启动服务器(即,没有这些选项)并为该'root'@'localhost'帐户分配新密码:

  1. 启动服务器。有关说明,请参见 第2.10.2节“启动服务器”

  2. 连接到服务器: 红色框中是密码

 

       3.安装服务

           mysqld  install   服务名

     4.启动服务

        net start  服务名

     5.连接mysql

       进入bin目录

       mysql -u root  -p

      回车 输入上面初始化的密码

     6.  修改密码

       alter user 'root'@'localhost' identified by 'mysql'; 

   SET PASSWORD = PASSWORD('123456');

附录:my.ini  配置

# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.7/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.

[mysql]
# 设置mysql客户端默认字符集
default-character-set=utf8mb4

[client]
# 设置mysql客户端连接服务端时默认使用的端口
port=3386   
default-character-set=utf8mb4

[mysqld]
#skip-grant-tables
# 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:/Mysql8.0/mysql-8.0.17-winx64
# 数据文件存放目录
 # datadir = D:/Mysql8.0/mysql-8.0.17-winx64/data
# 端口,默认3306  
  port = 3386
# 服务实例的唯一标识
 server_id = MySQL
 log-error="ddsoft.err"
# 允许最大连接数
  max_connections=200
# 允许连接失败的次数。这是为了防止有人从该主机试图攻击数据库系统
  max_connect_errors=10
# 服务端使用的字符集默认为utf8mb4
  character_set_server=utf8mb4
# 创建新表时将使用的默认存储引擎
  default-storage-engine=INNODB
# 默认使用“caching_sha2_password”插件认证
  default_authentication_plugin=caching_sha2_password
  
# 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 = 64M
  read_rnd_buffer_size = 64M 
  
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 


 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

mhi()

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值