当前位置: 首页 > news >正文

win10之mysql server 8.0.41安装

一 mysql server 下载

官网下载地址页面

https://dev.mysql.com/downloads/mysql/

在这里插入图片描述

二 免装版使用步骤

1 解压

下载完成后,解压文件夹,如下所示:
在这里插入图片描述

2 执行安装命令

D:\soft\mysql\mysql-8.0.41-winx64\mysql-8.0.41-winx64\bin>mysqld --install
Service successfully installed.

3 初始化mysql

D:\soft\mysql\mysql-8.0.41-winx64\mysql-8.0.41-winx64\bin>mysqld --initialize --console
2025-03-31T02:30:43.318917Z 0 [System] [MY-013169] [Server] D:\soft\mysql\mysql-8.0.41-winx64\mysql-8.0.41-winx64\bin\mysqld.exe (mysqld 8.0.41) initializing of server in progress as process 8224
2025-03-31T02:30:43.344538Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2025-03-31T02:30:44.019707Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2025-03-31T02:30:46.985785Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: :W*Vd?:b123*

初始化会产生一个随机密码,在最后一行显示,记住这个密码,登录会用到

4 开启服务

D:\soft\mysql\mysql-8.0.41-winx64\mysql-8.0.41-winx64\bin>net start mysql
MySQL 服务正在启动 .
MySQL 服务已经启动成功。

5 登录

D:\soft\mysql\mysql-8.0.41-winx64\mysql-8.0.41-winx64\bin>mysql -u root -h localhost -p

三 问题处理

在登录时候,可能会遇到一个问题,如下:

D:\soft\mysql\mysql-8.0.41-winx64\mysql-8.0.41-winx64\bin>mysql -u root -h localhost -p
Enter password: **
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
解决步骤
# 关闭服务
net stop mysql

# 通过控制台跳过密码表的加载和检查操作(不要关闭此CMD页面,另外以管理员身份打开CMD,然后输入mysql -u root,如果要求输入命令直接按Enter键跳过)
mysqld --console --skip-grant-tables --shared-memory

另外一个cmd窗口连接mqsql后,进行修改密码

D:\soft\mysql\mysql-8.0.41-winx64\mysql-8.0.41-winx64\bin>mysql -u root
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 8.0.41 MySQL Community Server - GPL

Copyright (c) 2000, 2025, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.


mysql>  FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.03 sec)

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';
Query OK, 0 rows affected (0.01 sec)

五 服务开启自启

在安装的bin目录下执行命令

D:\soft\mysql\mysql-8.0.41-winx64\mysql-8.0.41-winx64\bin>sc config mysql start=auto
[SC] ChangeServiceConfig 成功

在这里插入图片描述

相关文章:

  • 从像素到二值化:OpenCV图像处理实战入门指南
  • 虫洞数观系列二 | Python+MySQL高效封装:为pandas数据分析铺路
  • Spring Boot中常用内嵌数据库(H2、HSQLDB、Derby)的对比,包含配置示例和关键差异总结
  • PyTorch量化进阶教程:第一章 PyTorch 基础
  • 如何分辨三极管的三个极
  • leetcode01背包问题(C++)
  • Splunk PDF 格式要求
  • (Kotlin)Android 高效底部导航方案:基于预定义 Menu 和 ViewPager2 的 Fragment 动态绑定实现
  • 【微服务架构】SpringCloud Alibaba(三):负载均衡 LoadBalance
  • 算法练习(队列)
  • 框架修改思路
  • Elasticsearch安全与权限控制指南
  • CoAP Shell 笔记
  • cocos 图片上传与下载
  • C#:字符串插值(String Interpolation)
  • AI绘画 | Stable Diffusion 图片背景完美替换
  • 动态规划学习——背包问题
  • 如何模拟用户行为避免被检测到是爬虫?
  • 新手如何成为一名顶尖黑客?只需这十二个步骤轻松入门!
  • Apache Hive中数据类型转换为对应Snowflake中数据类型的方法
  • 网站网址怎么做二维码/百度快照下载
  • 纪实摄影网站推荐/泰安网站建设优化
  • 龙岗网站 建设深圳信科/平面设计培训费用一般是多少
  • 毕业设计论文网站/成品网站货源1
  • seo 网站优化/西安百度快速排名提升
  • 北京网站建设方案/如何写营销软文