Cannot connect to remote MySQL database

Bug Summary

I’m trying to connect to a remote MySQL database from my WordPress plugin. My code works on any other WordPress installation, but not with Local on Windows 10.

Steps to reproduce

Here is the minimal code to demonstrate this issue. You just need to change the arguments.

<?php $mysqli = mysqli_init(); if ( $mysqli ) { if ( ! $mysqli->real_connect( '1.2.3.4', 'username', 'password', 'database' ) ) { echo 'Connect Error (' . mysqli_connect_errno() . ') ' . mysqli_connect_error(); } else { echo 'Connected...' . $mysqli->host_info . "\n"; } } ?>

Environment Info

Local on Windows 10, using Apache, PHP, a remote MySQL database. Same issue with Nginx. Using Local version 6.5.2.

  • What Operating System are you using?
  • What versions of site software (Nginx, Apache, PHP, MySQL) is used?
  • What version of Local is installed?

Supporting info

Please provide your Local Log. See this Community Forum post for instructions on how to do so:

Include any screenshots or video recordings of the issue to help others reproduce.

Sorry, there are no log entries related to this issue. The connection just dies.