当前位置:网站首页>Windows下MySQL数据库报“ERROR 2003 (HY000): Can‘t connect to MySQL server on ‘localhost:8000‘ (10061)”错误解决
Windows下MySQL数据库报“ERROR 2003 (HY000): Can‘t connect to MySQL server on ‘localhost:8000‘ (10061)”错误解决
2022-08-02 03:26:00 【copcin】
前几天下载了MySQL,今天才想起来解压安装(前几天干嘛去了),但用mysql -uroot -p输入密码后给了我一个这样的答复:
C:\WINDOWS\system32>mysql -uroot -p
Enter password: ************
ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost:8000' (10061)我上网查了查发现都是诸如重启mysql服务呀(但我的MySQL服务已经重启了),更改端口号呀(我改了)……最后,我在网上搜到一篇改MySQLroot密码的文章,索性死马当活马医,试了试,居然成功了!
把过程贴出来分享,供参考
-------------------------正文------------------------
1. 软硬件信息(老样子)
软件:Windows 11
硬件:树莓派4b
2. 解决过程
第一步:
在搜索栏搜索“cmd”,双击两次“以管理员身份运行”即可,然后在两个窗口都输入“cd MySQL安装目录”,文中“MySQL安装目录”要替换成真实的安装目录,我是C:/mysql-8.0.27-winx64
第二步:
在一个窗口输入“mysqld --shared-memory”,如果错误先输下面两行再输:
mysqld --initialize
mysqld --install然后打开MySQL安装目录/data下的后缀名为.err的文件,复制带Note那行红圈后面的默认密码

第三步:
打开另一个窗口,再次输入'mysql -uroot -p',密码输自己的(如果刚才运行mysqld --shared-memory报错的输刚才复制的默认密码,
然后就是开心的食用时间~
C:\WINDOWS\system32>mysql -uroot -p
Enter password: ************
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.27
Copyright (c) 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>(在使用前记得 alter user 'root'@'localhost' identified by 'newpassword';重设密码,newpassword要换成你想重设的密码)
边栏推荐
- CTF入门之md5
- 英语每日打卡
- C language uses stack to calculate infix expressions
- DarkHole: 2 vulnhub walkthrough
- 账务处理程序、记账凭证账务处理程序、汇总记账凭证账务处理程序、科目汇总表账务处理程序、会计信息化概述、信息化环境下会计账务处理的基本要求(此章出1道小题)
- Pycharm packages the project as an exe file
- (7) superficial "crawlers" process (concept + practice)
- Laravel打印执行的SQL语句
- 强化学习笔记:DDPG
- Summary of php function vulnerabilities
猜你喜欢

CTF introductory notes ping

hackmyvm: controller walkthrough

Activity

The CTF introductory notes of SQL injection

CTF入门之php文件包含

GreenOptic: 1 vulnhub walkthrough

The first time to tear the code by hand, how to solve the problem of full arrangement

uniapp | Compilation error after updating with npm update

财产清查概述、 全面清查的情况、局部清查的情况、财产清查的方法、财产清查结果的处理

借贷记账法下的账户结构、借贷记账法的记账规则、借贷记账法下的账户对应关系与会计分录
随机推荐
同态加密:CKKS原理之旋转(Rotation)
库存现金、现金管理制度、现金的账务处理、银行存款、银行存款的账务处理、银行存款的核对
hackmyvm-random walkthrough
How to determine the direction based on two coordinate points on the map
Command Execution Vulnerability
php laravel框架生成二维码
GreenOptic: 1 vulnhub walkthrough
政府会计的概念、政府会计标准体系、政府会计的特点(会形成小考点)、政府会计要素及其确认和计量、政府预算会计要素、政府财务会计要素
MOMENTUM: 2 vulnhub walkthrough
C language uses stack to calculate infix expressions
强化学习笔记:DDPG
web渗透必玩的靶场——DVWA靶场 1(centos8.2+phpstudy安装环境)
Alfa: 1 vulnhub walkthrough
【泰山众筹】模式为什么一直都这么火热?是有原因的
CTF入门笔记之ping
laravel 查询数据库获取结果如何判断是否为空?
Smart Tips for Frida Scripting in Kali Environment
Solve the problem that the 5+APP real machine test cannot access the background (same local area network)
记账凭证的种类、记账凭证的基本内容、记账凭证的填制要求、记账凭证的审核
链动2+1无限循环系统,2022年起盘成功率超高的模式