Mysql8.0登录失败ERROR 2003 (HY000) Can‘t connect to MySQL server on ‘localhost‘

Mysql8.0登录失败ERROR 2003 (HY000) Can‘t connect to MySQL server on ‘localhost‘ ,第1张

cmd输入

>mysql -u root -p
控制台报10061
ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)
连接不上数据库,猜测可能是端口号不对
>mysql --help > mysqlHelp.txt
输出mysql帮助,查询到添加端口号是-P
D:javatoolse-mysql>mysql -uroot -P 3307 -p
Enter password: **********
Welcome to the MySQL monitor.  Commands end with ; or g.
Your MySQL connection id is 14
Server version: 8.0.13 MySQL Community Server - GPL

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

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>

登录成功

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/720129.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-04-25
下一篇 2022-04-25

发表评论

登录后才能评论

评论列表(0条)

保存