Skip to main content

Running Docker and attempting to install a web proxy environment where I'm attempting to create local web set up the consist of Drupal 9 with Composer + Docker-compose + Nginx + MariaDB + PHP8.1

However, when I run the command

docker-compose up

The terminal hangs at

Version: '10.6.5-MariaDB-1:10.6.5+maria~focal'  socket: '/run/mysqld/mysqld.sock'  port: 3306 binary distribution

So my initial question is to check the port mariadb is running on?  Is the port already in use?  However, how can I check what port(s) are in use?


How to get MySQL's port on Mac through terminal?

Initially I tried 

ps aux | grep mysql

The output was 

{name}   23335   0.0  0.0  4277640    748 s000  S+   10:03am   0:00.00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn --exclude-dir=.idea --exclude-dir=.tox mysql

Whereas, to listen in on ports in use with netstat

netstat -ap tcp | grep -i "listen"
tcp46      0      0  *.us-srv               *.*                    LISTEN
tcp46      0      0  *.cslistener           *.*                    LISTEN
tcp46      0      0  *.mysql                *.*                    LISTEN
tcp4       0      0  localhost.55181        *.*                    LISTEN
tcp6       0      0  *.55179                *.*                    LISTEN
tcp4       0      0  *.55179                *.*                    LISTEN
tcp46      0      0  *.http                 *.*                    LISTEN
tcp4       0      0  localhost.16494        *.*                    LISTEN
tcp4       0      0  localhost.15393        *.*                    LISTEN
tcp4       0      0  localhost.56952        *.*                    LISTEN
tcp4       0      0  localhost.45623        *.*                    LISTEN
tcp4       0      0  localhost.49544        *.*                    LISTEN
tcp4       0      0  localhost.49543        *.*                    LISTEN
tcp4       0      0  localhost.15292        *.*                    LISTEN
tcp4       0      0  localhost.cslistener   *.*                    LISTEN
tcp4       0      0  *.35729                *.*                    LISTEN



Related articles

Andrew Fletcher03 Nov 2023
Docker steps for rebuilding
Docker containers listTo view a list of Docker containers that are currently running, you can use the docker ps command. Open your terminal or command prompt and run the following command:docker psThis command will display a list of running containers, showing information like the container ID,...
Andrew Fletcher10 Aug 2023
sudo docker ps and exec -it
Working in an AWS ec2 environment, my goal is to access the server via terminal.I initially work to get the instance ID.  With this ID, I'm able to connect to the server.  When first accessing the environment on the server the steps I take are:sudo docker psps - refers to the 'process...
Andrew Fletcher27 Jul 2023
Exporting a MySQL table to a file
Goal: I want to download a table list to a txt or csv file.Initially, as a root user I tried using drushdrush sql-dump --tables-list=media_field_data > db-list.sqlOf course as a root user and Drush set-up not as root. failed with Command 'drush' not found, did you mean: command 'rush'...