The following error occurred in the last step of installing MySQL:
MySQL error 1042: unable to connect to any of the specified MySQL hosts
There are two solutions
First, treat the symptoms but not the root cause. Open Win + R and run it. Enter services.msc to open the service. Find the service name added when installing mysql. Generally, MySQL version 8.0 is MySQL 80 by default. Double click to open it. Under the login tab, change the selected account to the local system account.
It’s OK to execute after the application is confirmed, but this method needs to be operated once every time you reload mysql.
Another way is to configure group policy, which is a problem caused by the permission management of windows. The steps are as follows:
right click this computer – > Management – > Local users and groups – > Group – > Double click administrators – > Add – > Advanced
add network service to the administrators group
Read More:
- MySql Install Error: Can‘t connect to local MySQL server through socket ‘/tmp/mysql.sock‘
- [Solved] ERROR 2002 (HY000): Can’t connect to local MySQL server through socket’/var/lib/mysql/mysql.sock’ (2)
- How to Solve can‘t connect to local mysql server through socket ‘/var/lib/mysql/mysql.sock‘
- [Solved] MYSQL Command Execute Error: Can ‘t connect to local MySQL server through socket ‘/tmp/mysql.sock ‘(2) “
- How to Fix MySQL ERROR 1130 (HY000): Host ‘XXXX’ is not allowed to connect to this MySQL server
- host ‘‘ is not allowed to connect to this mysql server Connect MYSQL Error
- Remote connection to MySQL database error: is not allowed to connect to this MYSQL server solution
- Mysql Flashback Warning: C:\Program Files\MySQL\MySQL Server 8.0\bin\mysql.exe
- ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’
- MYSQL Enter password:ERROR 2003 (HY000): Can‘t connect to MySQL server on ‘localhost:3306‘
- [Solved] FATAL ERROR: please install the following Perl modules before executing /application/mysql/scripts/mysql_install_db: Data::Dumper
- mac brew install mysql ‘/tmp/mysql.sock’ (2) [How to Solve]
- How to Solve MYSQL Error: Failed to start MySQL 8.0 database server
- C# Connect MYSQL Error: MySql.Data.MySqlClient.MySqlException:“SSL Connection error.”
- (Fixed) workbench MySQL Error Code: 2013. Lost connection to MySQL server during query
- MYSQL Insert Data Error: check the manual that corresponds to your MySQL server version for the right syntax
- Ubuntu ERROR 2003 (HY000): Can’t connect to MySQL server on ‘127.0.0.1’ (111)
- [Solved] Django configures MySQL Error: NameError: name ”_MySQL ‘is not defined
- [Solved] CentOS installs MySQL and starts MySQL with error 2002 (HY000)
- MySQL Build table error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL ser