当前位置:网站首页>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要换成你想重设的密码)
边栏推荐
- Cookie is used to collect the admin privileges CTF foundation problem
- 成本会计的概念、产品成本核算的要求、产品成本核算的对象与成本项目、产品成本的归集和分配(可能考判断)、产品成本计算方法 (三种:产品的品种(品种法),批次(分批法),步骤(分步法))
- The CTF introduction of PHP file contains
- (4) Function, Bug, Class and Object, Encapsulation, Inheritance, Polymorphism, Copy
- xxe of CTF
- ES6 array extension methods map, filter, reduce, fill and array traversal for…in for…of arr.forEach
- 加密数字货币前传:从大卫·乔姆到中本聪
- Uniapp | compatibility problems in the development of (to be continued)
- 广告电商「私域打工人」职业前景:你离月薪6万,还差多远?
- Pycharm packages the project as an exe file
猜你喜欢
Praying: 1 vulnhub walkthrough
成本会计的概念、产品成本核算的要求、产品成本核算的对象与成本项目、产品成本的归集和分配(可能考判断)、产品成本计算方法 (三种:产品的品种(品种法),批次(分批法),步骤(分步法))
CTF入门笔记之ping
Offensive and defensive world - novice MISC area 1-12
The CTF introduction of PHP file contains
v-bind usage: class dynamic binding object array style style and function method
How to log in to Alibaba Cloud server using the admin account
hackmyvm-bunny预排
hackmyvm-bunny walkthrough
web渗透必玩的靶场——DVWA靶场 1(centos8.2+phpstudy安装环境)
随机推荐
hackmyvm-random walkthrough
CSRF (Cross Site Request Forgery)
PHP反序列化漏洞
2021-09-04 最简单的Golang定时器应用以及最简单的协程入门儿
英语每日打卡
【泰山众筹】模式为什么一直都这么火热?是有原因的
Phonebook
hackmyvm-bunny walkthrough
Sensitive information leakage
DNS详解
Orasi: 1 vulnhub walkthrough
Syncthing文件同步方案完全攻略(亲测有效)
Alfa: 1 vulnhub walkthrough
laravel-admin 线上访问项目,一直重定向到登录页面
3000字入门图神经网络
php laravel框架生成二维码
(4) Function, Bug, Class and Object, Encapsulation, Inheritance, Polymorphism, Copy
如何在正则表达式里表达可能存在也可能不存在的内容?
php中魔术方法详解
WeChat applet development video loading: [Rendering layer network layer error] Failed to load media