当前位置:网站首页>ERROR 2003 (HY000) Can't connect to MySQL server on 'localhost3306' (10061)Solution
ERROR 2003 (HY000) Can't connect to MySQL server on 'localhost3306' (10061)Solution
2022-07-31 04:44:00 【sebeefe】
This solution was prepared by me according to a series of methods on the Internet and suddenly succeeded, so I think it may be caused by its own instability
First of all, I downloaded the mysql file on the official website, and I can find how to download it anywhere on the Internet
After opening the file, I found that there is no my.ini
So I found a document and put it in there
[mysqld]# set port 3306port=3306# Set the installation directory of mysql ------- is your file path -------------basedir=F:mysql-8.0.27-winx64# Set the storage directory of the data of the mysql database --------- is your file path data folder created by yourself#datadir=F:mysql-8.0.27-winx64data# maximum number of connections allowedmax_connections=200# Allow connection failures.max_connect_errors=10# The character set used by the server defaults to utf8mb4character-set-server=utf8mb4# The default storage engine that will be used when creating new tablesdefault-storage-engine=INNODB# By default, the "mysql_native_password" plugin is used for authentication#mysql_native_passworddefault_authentication_plugin=mysql_native_password[mysql]# Set the default character set of the mysql clientdefault-character-set=utf8mb4[client]# Set the default port used by the mysql client to connect to the serverport=3306default-character-set=utf8mb4
Be careful not to copy, the file path is the path you downloaded yourself, and the data will be automatically generated when it is created, so just write the path, don't create it yourself, and don't change the name in the path, just call it data
p>The next step is to initialize the My SQL database
Switch to the bin directory, I opened it directly as an administrator
Copy the following code in the MySQLbin directory
mysqld --initialize --console
If this happens to me, it means that the data has been created. If the data is deleted, it can run normally again. If the data cannot be deleted, you need to hold down win+r and then enter services.msc, press Enter to find mysql
Then close it, you can delete the data
If the run is successful, you will see a [email protected]: in the note on the last line...The latter is a random initial password, write it down
Enter after
net start mysql
It will appear that the service is starting and the service is successful
Enter later
mysql -uroot -p
Enter will ask you to enter the password, this is where I start to have a headache, every time I enter the password it will appear
ERROR 2003 (HY000): Can’t connect to MySQL server on ‘localhost:3306’ (10061)
The whole self-closing, the operation is done step by step, why is there a problem (although there were some small problems before, but I have reminded everyone of the configuration method I mentioned above) Then I started to find a way to findI couldn't find the reason for a morning, so I repeated the above operation, deleted the data, then restarted mysql in services.msc, and then entered net start mysql in the command prompt to restart the service, I found that it seems thatIn services, mysql is not started immediately. After entering net start mysql, it takes a while for mysql to start. When mysql starts, I enter mysql -uroot -p again, and enter a random password, and it suddenly succeeds
I think it may be that mysql does not start immediately after being prompted in the command prompt for successful creation. You need to wait for the complete startup before you can enter the password and then enter
Change password
ALTER USER 'root'@'localhost' IDENTIFIED BY 'password you want to change';
Finally, I hope everyone can succeed once, and it crashes after seeing n times of ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost:3306' (10061)
Let me introduce myself first. The editor graduated from Jiaotong University in 2013. I worked in a small company and went to big factories such as Huawei and OPPO. I joined Ali in 2018, until now.I know that most junior and intermediate java engineers want to upgrade their skills, they often need to explore their own growth or sign up to study, but for training institutions, the tuition fee is nearly 10,000 yuan, which is really stressful.Self-learning that is not systematic is very inefficient and lengthy, and it is easy to hit the ceiling and the technology stops.Therefore, I collected a "full set of learning materials for java development" for everyone. The original intention is also very simple. I hope to help friends who want to learn by themselves but don't know where to start, and at the same time reduce everyone's burden.Add the business card below to get a full set of learning materials
边栏推荐
- 三道leetcode上的oj题
- type_traits metaprogramming library learning
- [CV project debugging] CUDNN_CONVOLUTION_FWD_SPECIFY_WORKSPACE_LIMIT problem
- 问题1:给你1-10的列表,实现列表输出,单数在左边,双数在右边。
- Two address pools r2 are responsible for managing the address pool r1 is responsible for managing dhcp relays
- MySQL 8.0.30 GA
- MATLAB/Simulink & & STM32CubeMX tool chain completes model-based design development (MBD) (three)
- "A daily practice, happy water problem" 1331. Array serial number conversion
- MySQL数据库备份
- $attrs/$listeners
猜你喜欢
Unity打灵狐者
[Linear Neural Network] softmax regression
(五)final、抽象类、接口、内部类
Two address pools r2 are responsible for managing the address pool r1 is responsible for managing dhcp relays
BUG destroyer!!Practical debugging skills are super comprehensive
打造基于ILRuntime热更新的组件化开发
【小土堆补充】Pytorch学习笔记_Anaconda虚拟环境使用
(八)Math 类、Arrays 类、System类、Biglnteger 和 BigDecimal 类、日期类
View source and switch mirrors in two ways: npm and nrm
【云原生】DevOps(五):集成Harbor
随机推荐
论治理与创新 | 2022开放原子全球开源峰会OpenAnolis分论坛圆满召开
【wpf】wpf中的那些模板之深度解析
开源社区三十年 | 2022开放原子全球开源峰会开源社区三十年专题活动圆满召开
VScode+ESP32 quickly install ESP-IDF plugin
两个地址池r2负责管地址池r1负责管dhcp中继
重磅 | 开放原子校源行活动正式启动
关于出现大量close_wait状态的理解
View source and switch mirrors in two ways: npm and nrm
手把手实现图片预览插件(三)
C# 实现PLC的定时器
MATLAB/Simulink&&STM32CubeMX工具链完成基于模型的设计开发(MBD)(三)
visual studio 那些提高效率的快捷键,总结(不时更新)
Minesweeper game - C language
Lua,ILRuntime, HybridCLR(wolong)/huatuo热更新对比分析
$attrs/$listeners
Fusion Cloud Native, Empowering New Milestones | 2022 Open Atom Global Open Source Summit Cloud Native Sub-Forum Successfully Held
MySQL fuzzy query can use INSTR instead of LIKE
Win10 CUDA CUDNN installation configuration (torch paddlepaddle)
Safety 20220715
剑指offer专项突击版第15天