[wp-trac] [WordPress Trac] #64014: Optionally expose non-ephemeral MySQL port

WordPress Trac noreply at wordpress.org
Sat Sep 20 00:59:50 UTC 2025


#64014: Optionally expose non-ephemeral MySQL port
------------------------------+-------------------------
 Reporter:  westonruter       |      Owner:  westonruter
     Type:  enhancement       |     Status:  assigned
 Priority:  normal            |  Milestone:  6.9
Component:  Build/Test Tools  |    Version:  5.4
 Severity:  normal            |   Keywords:
  Focuses:                    |
------------------------------+-------------------------
 I've finally sat down to try to get PhpStorm to connect to the MySQL
 database in the wordpress-develop Docker environment. To do so, I needed
 to supply the port number for the mysql container. As noted in #48281,
 this can be done via:

 {{{
 docker-compose port mysql 3306
 }}}

 But it is annoying to have to re-run this to update the port in the
 PhpStorm database properties each time I start the wordpress-develop
 environment. Therefore, as with the `LOCAL_PORT` environment variable in
 `.env` for the web server, I suggest there be a `LOCAL_DB_PORTS`
 environment variable supported which allows a persistent port mapping to
 be established for the database:

 {{{#!diff
 --- a/docker-compose.yml
 +++ b/docker-compose.yml
 @@ -70,7 +70,7 @@ services:
        - wpdevnet

      ports:
 -      - "3306"
 +      - ${LOCAL_DB_PORTS-3306}

      environment:
        MYSQL_ROOT_PASSWORD: password
 }}}

 With this change in place, I can update my `.env` to contain:

 {{{
 LOCAL_DB_PORTS="33060:3306"
 }}}

 And then my wordpress-develop mysql container is always accessible from
 the same `33060` port.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/64014>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list