服务器之家:专注于服务器技术及软件下载分享
分类导航

Mysql|Sql Server|Oracle|Redis|MongoDB|PostgreSQL|Sqlite|DB2|mariadb|Access|数据库技术|

服务器之家 - 数据库 - Mysql - 解决MySQL启动报错:ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)

解决MySQL启动报错:ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)

2021-08-26 16:36那记忆微凉 Mysql

这篇文章主要介绍了解决MySQL启动报错:ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061),本文解释了如何解决该问题,以下就是详细内容,需要的朋友可以参考下

这个错误是新手经常会遇到的,本文主要介绍如何修复ERROR 2003 (HY000): Can't connect to MySQL server on ‘localhost' (10061)
解决方案:
1、登录到安装Mysql的主机,打开cmd命令行工具,执行命令mysql -uroot -p,报出下面所描述的错误;

解决MySQL启动报错:ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)

2、在开始菜单中找到计算机管理,在计算机管理中找到【服务】,在服务检查是否存在Mysql服务;

解决MySQL启动报错:ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)

解决MySQL启动报错:ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)

3、如果【步骤2】中找不到Mysql服务需要手动安装Mysql服务,安装命令为mysqld -install,由于本机中已经安装了mysql服务,所以有如下提示The service already exists!

解决MySQL启动报错:ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)

4、如果【步骤2】中能够找到Mysql服务,双击此服务查看服务的当前状态,如果没有运行,点击【启动】运行服务;

解决MySQL启动报错:ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)

5、此外,还可以通过在cmd中执行命令net start mysql命令来启动Mysql服务;

解决MySQL启动报错:ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)

6、Mysql服务启动成功后再次执行【步骤1】中的命令,便可正常连接到Mysql数据库了。

解决MySQL启动报错:ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)

到此这篇关于解决MySQL启动报错:ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)的文章就介绍到这了,更多相关MySql报错:ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)内容请搜索服务器之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持服务器之家!

原文链接:https://blog.csdn.net/BigData_Mining/article/details/88344513

延伸 · 阅读

精彩推荐