当前位置:网站首页>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要换成你想重设的密码)
边栏推荐
猜你喜欢

对账、结账、错账更正方法、划线更正法、红字更正法、补充登记法

Eric target penetration test complete tutorial

(6) Design of student information management system

hackmyvm: may walkthrough

ES6 array extension methods map, filter, reduce, fill and array traversal for…in for…of arr.forEach

v-bind usage: class dynamic binding object array style style and function method

最简单的FRP内网穿透教程

hackmyvm: juggling walkthrough

hackmyvm: again walkthrough

2021-09-04 最简单的Golang定时器应用以及最简单的协程入门儿
随机推荐
laravel-admin FROM表单同行展示问题
超级云APP,陪伴您一起成长的软件
最简单的FRP内网穿透教程
(2) Sequence structures, Boolean values of objects, selection structures, loop structures, lists, dictionaries, tuples, sets
A network security guinea pig's learning path - scripting of advanced usage of nmap
laravel-admin 线上访问项目,一直重定向到登录页面
uniapp | Problems with the use of the official map component
CTF-网鼎杯往届题目
GreenOptic: 1 vulnhub walkthrough
CTF之xxe
账务处理程序、记账凭证账务处理程序、汇总记账凭证账务处理程序、科目汇总表账务处理程序、会计信息化概述、信息化环境下会计账务处理的基本要求(此章出1道小题)
政府会计的概念、政府会计标准体系、政府会计的特点(会形成小考点)、政府会计要素及其确认和计量、政府预算会计要素、政府财务会计要素
xxe of CTF
centos8 安装搭建php环境
Phonebook
hackmyvm: may walkthrough
链动2+1无限循环系统,2022年起盘成功率超高的模式
Warzone: 3 (Exogen) vulnhub walkthrough
web安全之目录遍历
Masashi: 1 vulnhub walkthrough