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

OPENSSL基本实验以及OPENSSL详解

hackmyvm-hopper预排

Laravel打印执行的SQL语句

CTF入门之php文件包含

file contains vulnerabilities

C language uses stack to calculate infix expressions

Command Execution Vulnerability

The CTF introduction of PHP file contains

ES6 iterator explanation example

v-bind usage: class dynamic binding object array style style and function method
随机推荐
MOMENTUM: 2 vulnhub walkthrough
英语每日打卡
After Alibaba Cloud sets up domain name resolution redirection, I cannot use Chrome to access it
Alfa: 1 vulnhub walkthrough
Laravel随笔记录
CTF入门笔记之SQL注入
Shuriken: 1 vulnhub walkthrough
ES6 iterator explanation example
mysql 原生语句点滴学习记录
hackmyvm-bunny walkthrough
A code audit notes (CVE - 2018-12613 phpmyadmin file contains loopholes)
公司产品太多了,怎么实现一次登录产品互通?
解决flex布局warp自动换行下最后一行居中问题
hackmyvm: juggling walkthrough
解密:链动2+1的商业模式
会计凭证概述、原始凭证、原始凭证的种类、原始凭证的基本内容、原始凭证的填制要求、原始凭证的审核
(5) Modules and packages, encoding formats, file operations, directory operations
管理会计(对内)指引、管理会计要素及其具体内容(可能考,考前记一下,推荐记一下四个大点即可)、
真·杂项:资本论阅读笔记(随缘更新)
Scrapy crawler encounters redirection 301/302 problem solution