当前位置:网站首页>The MySQL database installed configuration nanny level tutorial for 8.0.29 (for example) have hands
The MySQL database installed configuration nanny level tutorial for 8.0.29 (for example) have hands
2022-07-31 04:44:00 【sebeefe】
MySQL数据库安装配置保姆级教程(以8.0.29为例)有手就行
本教程适合在MySQL登录时一直出现ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: YES)的朋友们,教程写得很详细了,已经非常啰嗦了,但是又害怕有很多在这第一步上经常会出问题的朋友出现,所以做了这个教程
MySQL下载
1、找到官网链接: link https://www.mysql.com/
滑到最下方找到DOWNLOADS下载;
点击MySQL Community Server(社区版);
选择下载较小的那个压缩包;
2、将mysql的 zip 包解压到相应的目录,重命名为mysql.
MySQL安装
1、创建MySQL 的配置文件,在mysql文件夹下新建一个my.txt文件,改后缀名为ini(Move the folder menu bar“查看“Check this item)
win11用户:
2、Then edit the created onemy.ini文件 (记事本打开),将下面的内容复制到my.ini文件中,basedirRemember to modify the content after that to your actual installation path.
[mysql]
# 设置mysql客户端默认字符集
default-character-set=utf8
[mysqld]
# 设置mysql默认端口号
port=3306
# 设置mysql的安装目录
basedir=C:mysql
# 允许最大连接数
max_connections=20
# 服务端使用的字符集默认为utf-8
character-set-server=utf8
# 创建新表时将使用的默认存储引擎
default-storage-engine=INNODB
环境变量
3、右键桌面的“此电脑”找到属性,在新窗口中找到“高级系统设置”
找到环境变量
在用户变量的Path中添加mysql的路径
先点击新建,再点击浏览
找到mysqlindirectory and click确定,All the way to confirm to save
4、打开CMD命令行(It is strongly recommended to open it as an administrator),切换到C:/mysql/bin目录下.
4、初始化数据库,输入如下命令(注意是在C:/mysql/bin目录下):
mysqld --initialize --console
执行完成后,会输出root用户的初始默认密码(The password obtained at this time is not important for this tutorial)
The default password I derived here is :)2C*YZ;+sVQw
5、安装mysql服务,命令如下:
mysqld install
This command must be used in the command box under administrator status
Otherwise you will be promptedInstall/Remove of the Service Denied!(拒绝安装)
6.启动mysql服务,命令如下:
net start mysql
7.初始化data目录,命令如下:
mysqld --initialize-insecure
8.At this point there is an option to log in but the initial password is too complex
修改密码(可强行修改)
This method can change the password without knowing the original password
此时我们在mysql根目录创建一个txtThe file name is arbitrarily chosen here I named itmm.txt
在txt文件下加入以下内容:
ALTER USER 'root'@localhost IDENTIFIED BY '123456';
意思是将密码设置成123456
Open the command box again as an administrator
先暂停mysql服务
net stop mysql
命令行方式启动服务器,After executing the above password modification command file at startup, the process will be occupied for a period of time
Note the address is hereC:mysqlmm.txt需要改成你的mm.txt所在地址
mysqld --init-file=C:mysqlmm.txt --console
This time we close the command box,Then reopen a new command box,Launch in the reopened command boxmysql服务
net start mysql
After that try to open the loginmysql
mysql -uroot -p
或者
mysql -uroot -p123456
END
Many students still have problems,比如说出现:
Enter password: ******
ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: YES)
This situation meansusing password: YESYou entered your password,如果这里是NOIndicates that you did not enter a password
There are two reasons for this problem,The first case is that it cannot be connectedmysql服务器(In general, it is a problem of permissions and a problem of not starting the service,一般不会出现这个问题),The second case is that the password is wrong(You can follow the tutorial again,It may be that the password change has not been successfully changed)
教程写得很详细了,已经非常啰嗦了,但是又害怕有很多在这第一步上经常会出问题的朋友出现,所以做了这个教程,感谢你们的观看!
先自我介绍一下,小编13年上师交大毕业,曾经在小公司待过,去过华为OPPO等大厂,18年进入阿里,直到现在.深知大多数初中级java工程师,想要升技能,往往是需要自己摸索成长或是报班学习,但对于培训机构动则近万元的学费,着实压力不小.自己不成体系的自学效率很低又漫长,而且容易碰到天花板技术停止不前.因此我收集了一份《java开发全套学习资料》送给大家,初衷也很简单,就是希望帮助到想自学又不知道该从何学起的朋友,同时减轻大家的负担.添加下方名片,即可获取全套学习资料哦
边栏推荐
- log level and print log note
- Create componentized development based on ILRuntime hot update
- MySQL基础操作
- STM32HAL库修改Hal_Delay为us级延时
- 剑指offer专项突击版第15天
- The input input box displays the precision of two decimal places
- 强化学习:从入门到入坑再到拉屎
- On Governance and Innovation | 2022 OpenAtom Global Open Source Summit OpenAnolis sub-forum was successfully held
- 【C语言】操作符详解
- MySQL to revise the root password
猜你喜欢
idea工程明明有依赖但是文件就是显示没有,Cannot resolve symbol ‘XXX‘
qlib架构
ERROR 1064 (42000) You have an error in your SQL syntax; check the manual that corresponds to your
HCIP Day 10_BGP Route Summary Experiment
HCIP第十天_BGP路由汇总实验
ENSP, VLAN division, static routing, comprehensive configuration of Layer 3 switches
npm、nrm两种方式查看源和切换镜像
[debug highlights] Expected input batch_size (1) to match target batch_size (0)
MATLAB/Simulink&&STM32CubeMX工具链完成基于模型的设计开发(MBD)(三)
Knowledge Distillation 7: Detailed Explanation of Knowledge Distillation Code
随机推荐
ENSP,划分VLAN、静态路由,三层交换机综合配置
WPF WPF 】 【 the depth resolution of the template
input输入框展示两位小数之precision
[CV project debugging] CUDNN_CONVOLUTION_FWD_SPECIFY_WORKSPACE_LIMIT problem
Unity Fighter
exsl文件预览,word文件预览网页方法
Summary of Huawei Distributed Storage FusionStorage Knowledge Points [Interview]
马斯克对话“虚拟版”马斯克,脑机交互技术离我们有多远
【C语言进阶】文件操作(一)
Explanation of
MySQL数据库备份
VScode+ESP32 quickly install ESP-IDF plugin
问题7:列表的拼接
MySQL fuzzy query can use INSTR instead of LIKE
Safety 20220715
View source and switch mirrors in two ways: npm and nrm
开源社区三十年 | 2022开放原子全球开源峰会开源社区三十年专题活动圆满召开
Thinking about data governance after Didi fines
MySQL database must add, delete, search and modify operations (CRUD)
[py script] batch binarization processing images