MySQL安装及密码修改

正文:


操作系统:Microsoft Windows 10 21H1

MySQL版本:MySQL Community Server 8.0.26

Java环境:

Java™ SE Runtime Environment (build 15.0.1+9-18)

Java HotSpot™ 64-Bit Server VM (build 15.0.1+9-18, mixed mode, sharing)

安装过程:

Java环境搭建:

看一看龙龙之前写过的吧,不过多赘述了呦~~(主要是比较懒,嘿嘿):

https://blog.csdn.net/weixin_46056304/article/details/108987409?spm=1001.2014.3001.5502

MySQL下载:


网址:

https://dev.mysql.com/downloads/mysql/在这里插入图片描述

一、安装:

C:\Windows\system32>d: #切换到D盘

D:>cd MySQL\SQL\bin #切换到MySQL文件夹

D:\MySQL\SQL\bin>mysqld --initialize --console #初始化MySQL

2021-07-26T11:51:37.672431Z 0 [System] [MY-013169] [Server] D:\MySQL\SQL\bin\mysqld.exe (mysqld 8.0.26) initializing of server in progress as process 6024

2021-07-26T11:51:37.679627Z 0 [Warning] [MY-013242] [Server] --character-set-server: ‘utf8’ is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous.

2021-07-26T11:51:37.695772Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.

2021-07-26T11:51:38.187110Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.

2021-07-26T11:51:39.493894Z 0 [Warning] [MY-013746] [Server] A deprecated TLS version TLSv1 is enabled for channel mysql_main

2021-07-26T11:51:39.494483Z 0 [Warning] [MY-013746] [Server] A deprecated TLS version TLSv1.1 is enabled for channel mysql_main

2021-07-26T11:51:39.594086Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: havj1rP#5Xct #初始密码

D:\MySQL\SQL\bin>mysqld install #安装MySQL

The service already exists!

The current server installed: D:\MySQL\SQL\bin\mysqld MySQL

D:\MySQL\SQL\bin>net start mysql #启动服务

MySQL 服务正在启动 .

MySQL 服务已经启动成功。

D:\MySQL\SQL\bin>mysql -u root -p #登录

Enter password: ************

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 8

Server version: 8.0.26

Copyright © 2000, 2021, 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>

二.修改密码:

C:\Users\ASUS\Desktop>mysql -u root -p #使用初始密码登录

Enter password: *********

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 16

Server version: 8.0.26 MySQL Community Server - GPL

Copyright © 2000, 2021, 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> use mysql;

Database changed

mysql> update user set authentication_string=‘’ where user=‘root’; #清空authentication_string

Query OK, 1 row affected (0.00 sec)

Rows matched: 1 Changed: 1 Warnings: 0

mysql> alter user ‘root’@‘localhost’ identified by ‘newpassword’; #设置新的密码,newpassword就是新的密码

Query OK, 0 rows affected (0.01 sec)

mysql> flush privileges; #刷新MySQL的系统权限相关表,此过程是必要过程, 否则会出现拒绝访问

Query OK, 0 rows affected (0.00 sec)

mysql> exit;

Bye

三.修改密码(忘记密码的操作):

1.先以管理员身份打开一个DOS窗口:

C:\Users\ASUS\Desktop> stop mysql #停止MySQL服务
自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。

深知大多数Java工程师,想要提升技能,往往是自己摸索成长或者是报班学习,但对于培训机构动则几千的学费,着实压力不小。自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!

因此收集整理了一份《2024年Java开发全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友,同时减轻大家的负担。img

既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上Java开发知识点,真正体系化!

由于文件比较大,这里只是将部分目录截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且会持续更新!

如果你觉得这些内容对你有帮助,可以扫码获取!!(备注Java获取)

img

最后

金三银四到了,送上一个小福利!

image.png

image.png

专题+大厂.jpg
《互联网大厂面试真题解析、进阶开发核心学习笔记、全套讲解视频、实战项目源码讲义》点击传送门即可获取!
1713248309979)]

[外链图片转存中…(img-bg0BJbvv-1713248309980)]

[外链图片转存中…(img-86wzpCWZ-1713248309980)]
《互联网大厂面试真题解析、进阶开发核心学习笔记、全套讲解视频、实战项目源码讲义》点击传送门即可获取!

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值