# Docker Mysql with GitHub Action error

**URL:** <https://forums.docker.com/t/docker-mysql-with-github-action-error/143191>\
**Category:** General\
**Tags:** docker, mysql\
**Created:** [August 18, 2024, 11:31pm UTC](https://forums.docker.com/t/docker-mysql-with-github-action-error/143191 "2024-08-18T23:31:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![newuser77](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/newuser77/32/43329_2.png) [@newuser77](https://forums.docker.com/u/newuser77)\
**Post date:** [August 18, 2024, 11:31pm UTC](https://forums.docker.com/t/docker-mysql-with-github-action-error/143191/1 "2024-08-18T23:31:31Z")

</div>

Hello Dears,

I Don’t know where to put my issue so i will put it here  
(Kindly if i should put it at another place please inform me)

I have this issue when i run my GitHub action Pipeline :

**GitHub Action Pipeline:**

* * *

```auto
name: Run Docker Image, Show Databases, and Tables

on:
  push:
    paths: .github/workflows/my-flow2.yml

jobs:
  build:
    runs-on: ubuntu-latest
    container: (abc)/mysql-Image

    steps:
      - uses: actions/checkout@v3
      
      
      - name: Wait for MySQL to start
        run: sleep 90 # Adjust the sleep time as necessary

      
      - name: Show databases
        run: mysql -uroot -prootpassword -e "SHOW DATABASES;" # Show databases

```

* * *

**Error in GitHub actions :**

Run mysql -uroot -prootpassword -e “SHOW DATABASES;”

Warning: arning] Using a password on the command line interface can be insecure.

ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)

Error: Process completed with exit code 1.

* * *

**My Dockerfile:**

# Use the official MySQL image from the Docker Hub  
FROM mysql:latest

# Environment variables for MySQL  
ENV MYSQL\_ROOT\_PASSWORD=rootpassword  
ENV MYSQL\_DATABASE=school  
ENV MYSQL\_USER=user  
ENV MYSQL\_PASSWORD=password

# Add the initialization SQL script  
COPY init.sql /docker-entrypoint-initdb.d/

# Expose MySQL port  
EXPOSE 3306

* * *

Can you help me?

---

<div class="post-metadata">

**Author:** ![deanayalon](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/deanayalon/32/49113_2.png) [@deanayalon](https://forums.docker.com/u/deanayalon)\
**Post date:** [August 19, 2024, 12:59am UTC](https://forums.docker.com/t/docker-mysql-with-github-action-error/143191/2 "2024-08-19T00:59:04Z")

</div>

I see a checkout step, and a sleep step, but no step that actually starts the database

---

<div class="post-metadata">

**Author:** ![newuser77](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/newuser77/32/43329_2.png) [@newuser77](https://forums.docker.com/u/newuser77)\
**Post date:** [August 19, 2024, 8:39am UTC](https://forums.docker.com/t/docker-mysql-with-github-action-error/143191/3 "2024-08-19T08:39:16Z")

</div>

Thank you for your response, i already at another actions starts database…  
kindly find below all of my tests and in each one what is the error that i faced, can you help me?

* * *

0s

Run service mysql start

service: command not found

Error: Process completed with exit code 127.

* * *

Run systemctl mysql start

systemctl: command not found

Error: Process completed with exit code 127.

* * *

Run mysqld &

2024-08-18T22:43:27.077228Z 0 [System] [MY-015015] [Server] MySQL Server - start.

2024-08-18T22:43:27.266427Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 9.0.1) starting as process 39

Warning: 8T22:43:27.275339Z 0 [Warning] [MY-010075] [Server] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 48be92af-5db3-11ef-9cb8-0242ac120002.

)2024-08-18T22:43:27.278390Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.

)Error: -18T22:43:27.298059Z 1 [ERROR] [MY-012592] [InnoDB] Operating system error number 2 in a file operation.

Error: -18T22:43:27.298092Z 1 [ERROR] [MY-012593] [InnoDB] The error means the system cannot find the path specified.

)Error: -18T22:43:27.298100Z 1 [ERROR] [MY-012594] [InnoDB] If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.

)Error: -18T22:43:27.298108Z 1 [ERROR] [MY-012646] [InnoDB] File ./ibdata1: ‘open’ returned OS error 71. Cannot continue operation

)Error: -18T22:43:27.298149Z 1 [ERROR] [MY-012981] [InnoDB] Cannot continue operation.

Run mysql -uroot -prootpassword -e “SHOW DATABASES;”

Run mysql -uroot -prootpassword -e “SHOW DATABASES;”

Warning: arning] Using a password on the command line interface can be insecure.

ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)

Error: Process completed with exit code 1.

* * *

Run mysqld &

2024-08-18T22:45:12.630509Z 0 [System] [MY-015015] [Server] MySQL Server - start.

2024-08-18T22:45:12.832196Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 9.0.1) starting as process 39

Warning: 8T22:45:12.841478Z 0 [Warning] [MY-010075] [Server] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 87aaafe4-5db3-11ef-9e33-0242ac120002.

2024-08-18T22:45:12.845494Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.

Error: -18T22:45:12.866000Z 1 [ERROR] [MY-012592] [InnoDB] Operating system error number 2 in a file operation.

Error: -18T22:45:12.866035Z 1 [ERROR] [MY-012593] [InnoDB] The error means the system cannot find the path specified.

Error: -18T22:45:12.866043Z 1 [ERROR] [MY-012594] [InnoDB] If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.

Error: -18T22:45:12.866051Z 1 [ERROR] [MY-012646] [InnoDB] File ./ibdata1: ‘open’ returned OS error 71. Cannot continue operation

Error: -18T22:45:12.866063Z 1 [ERROR] [MY-012981] [InnoDB] Cannot continue operation.

Wait for MySQL to start

20s

Run sleep 20

Check MySQL Status

Run mysqladmin -uroot -prootpassword ping

Warning: n: [Warning] Using a password on the command line interface can be insecure.

amysqladmin: connect to server at ‘localhost’ failed

)error: ‘Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)’

Check that mysqld is running and that the socket: ‘/var/run/mysqld/mysqld.sock’ exists!

Error: Process completed with exit code 1.

---

<div class="post-metadata">

**Author:** ![deanayalon](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/deanayalon/32/49113_2.png) [@deanayalon](https://forums.docker.com/u/deanayalon)\
**Post date:** [August 19, 2024, 9:56am UTC](https://forums.docker.com/t/docker-mysql-with-github-action-error/143191/4 "2024-08-19T09:56:54Z")

</div>

I don’t know, but I think your issue may be with GitHub Actions, I believe asking in a related forum would be more helpful

---

<div class="post-metadata">

**Author:** ![newuser77](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/newuser77/32/43329_2.png) [@newuser77](https://forums.docker.com/u/newuser77)\
**Post date:** [August 19, 2024, 11:08am UTC](https://forums.docker.com/t/docker-mysql-with-github-action-error/143191/5 "2024-08-19T11:08:54Z")

</div>

Thank you for your support, I will.
