Search code examples
mysqldatabaseremote-accesswindows-server-2019

Problem with remote connection to MySQL database (Error 1045)


I installed MySQL Server 8.0 on Windows Server 2019, during installation I created user 'superna' @ ' %' with DBAdmin rights. When connecting from a local machine, there are no problems (mysql -u superna -p), but when trying to connect from a remote machine (mysql -h 10.165.1.20 -u superna -p), error 1045 is returned. I checked the availability of port 3306 using nmap, port is open.

select User, Host from mysql.user;

nmap -p 3306 10.165.1.20

mysql -h 10.165.1.20 -u superna -p

netstat

When installing mysql server on Windows 10, such problems are not observed, the connection from the remote machine works correctly. Can you tell me what point in the settings I might be missing?


Solution

  • Problem solved. The server was configured to NAT port 3306 to another machine on the network.