Skip to content

eltoro0815/ddev_forward_dynamic_mysql_host_port

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

ddev_forward_dynamic_mysql_host_port

This is a PowerShell script ddev_forward_dynamic_mysql_host_port_port.ps1. This gets the dynamic port from the ddev describe json output and updates port forwarding using the netsh interface portproxy command.

Why do we want this? We can now connect to port 3306 on our host and reach the MySQL database in the container. The port generated by ddev and accessible by the host, on the other hand, is regenerated every time the container is restarted and changes randomly.

  1. get jq from https://stedolan.github.io/jq/download/ (it is needed to read the json output).
  2. put the ddev_forward_dynamic_mysql_host_port.ps1 script in your project folder.
  3. run the script as administrator.

Screenshot

Credits

This script uses the following open source components:

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published