search
HomeDatabaseMysql TutorialMySQL localhost (10061)解决方法

在搞开发时经常会碰到MySQL localhost (10061)解决方法 这种问题,以前我因为打了wind TCP/IP更新补丁(KB967723),出错,今天又不一样了,下面是解决办法,有需要的朋友分析一下。

第一步

删除c:windowns下面的my.ini

第二步

打开c:binwinmysqladmin.exe 输入用户名 和密码

第三步 在dos下 输入 mysqld-nt -remove 删除服务

在接着输入 mysqld-nt -install

第四步 输入mysql 启动成功。

其它可参考的方法:

1.看看hosts文件中localhost是不是指向127.0.0.1

2.如果是没启动mysql服务,则可运行net start mysql。

3.一些相关命令:

mysqld-nt --install #启动Mysql

mysql #运行Mysql

mysql -h ipAddress -u username -p

或者:直接去bin里点mysqld.exe或mysqld-nt.exe,看下它的进程能否正常运行,如不行,再去控制面板,服务里去启动它,看下是什么错误。如果不行,就在添加删除里删去mysql,然后再重装mysql,一般都能解决问题,可以在安装前备份一下DATA。

Error: Can't connect to MySQL server on 'localhost' (10061)

Errno.: 2003

错误编号:2003

问题分析:

无法连接到 MySQL 服务器,可能的情况为:

1、MySQL 服务没有启动,一般是在异常的情况下 MySQL 无法启动导致的,比如无可用的磁盘空间,my.ini 里 MySQL 的 basedir 路径设置错误等;

2、MySQL 服务器资源紧张,导致无法连接。

解决方法:

1、如果你是虚拟主机用户(购买的空间),则联系空间商检查 MySQL 是否正常启动,并确认 MySQL 的配置信息(是否为 localhost);

2、如果你是独立主机用户(拥有管理主机权限),则按下面步骤检查:

     1)检查磁盘空间是否还有剩余可用空间,尽量保持有足够的磁盘空间可用。

     2)检查 my.ini 里的 basedir (MySQL 安装地址) 和 datadir (数据目录存放地址)等参数设置是否正确,然后重新启动下 MySQL 服务。

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
How to solve the problem of mysql cannot open shared libraryHow to solve the problem of mysql cannot open shared libraryMar 04, 2025 pm 04:01 PM

This article addresses MySQL's "unable to open shared library" error. The issue stems from MySQL's inability to locate necessary shared libraries (.so/.dll files). Solutions involve verifying library installation via the system's package m

Reduce the use of MySQL memory in DockerReduce the use of MySQL memory in DockerMar 04, 2025 pm 03:52 PM

This article explores optimizing MySQL memory usage in Docker. It discusses monitoring techniques (Docker stats, Performance Schema, external tools) and configuration strategies. These include Docker memory limits, swapping, and cgroups, alongside

How do you alter a table in MySQL using the ALTER TABLE statement?How do you alter a table in MySQL using the ALTER TABLE statement?Mar 19, 2025 pm 03:51 PM

The article discusses using MySQL's ALTER TABLE statement to modify tables, including adding/dropping columns, renaming tables/columns, and changing column data types.

Run MySQl in Linux (with/without podman container with phpmyadmin)Run MySQl in Linux (with/without podman container with phpmyadmin)Mar 04, 2025 pm 03:54 PM

This article compares installing MySQL on Linux directly versus using Podman containers, with/without phpMyAdmin. It details installation steps for each method, emphasizing Podman's advantages in isolation, portability, and reproducibility, but also

What is SQLite? Comprehensive overviewWhat is SQLite? Comprehensive overviewMar 04, 2025 pm 03:55 PM

This article provides a comprehensive overview of SQLite, a self-contained, serverless relational database. It details SQLite's advantages (simplicity, portability, ease of use) and disadvantages (concurrency limitations, scalability challenges). C

How do I configure SSL/TLS encryption for MySQL connections?How do I configure SSL/TLS encryption for MySQL connections?Mar 18, 2025 pm 12:01 PM

Article discusses configuring SSL/TLS encryption for MySQL, including certificate generation and verification. Main issue is using self-signed certificates' security implications.[Character count: 159]

Running multiple MySQL versions on MacOS: A step-by-step guideRunning multiple MySQL versions on MacOS: A step-by-step guideMar 04, 2025 pm 03:49 PM

This guide demonstrates installing and managing multiple MySQL versions on macOS using Homebrew. It emphasizes using Homebrew to isolate installations, preventing conflicts. The article details installation, starting/stopping services, and best pra

What are some popular MySQL GUI tools (e.g., MySQL Workbench, phpMyAdmin)?What are some popular MySQL GUI tools (e.g., MySQL Workbench, phpMyAdmin)?Mar 21, 2025 pm 06:28 PM

Article discusses popular MySQL GUI tools like MySQL Workbench and phpMyAdmin, comparing their features and suitability for beginners and advanced users.[159 characters]

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

Repo: How To Revive Teammates
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor