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

 

 

 

服务启动后,使用初始密码访问,有这个异常,可能默认是3306吧。

加上端口访问就可以了:如下:mysql -uroot -P 3308 -p

 

D:\softDev\mysql8\mysql-8.0.16-winx64\bin>net start mysql8
MYSQL8 服务正在启动 ..
MYSQL8 服务已经启动成功。


D:\softDev\mysql8\mysql-8.0.16-winx64\bin>mysql -u root -p
Enter password: ************
ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)

D:\softDev\mysql8\mysql-8.0.16-winx64\bin>mysql --help > mysqlHelp.txt

D:\softDev\mysql8\mysql-8.0.16-winx64\bin>mysql -uroot -P 3308 -p
Enter password: ************
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.16

Copyright (c) 2000, 2019, 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>

 

你可能感兴趣的:(mysql)