setup-mysql setup-mysql

setup-mysql

Setup MySQL Action

Test Linux Test macOS Test Windows License

Overview

This GitHub Action automates the setup and configuration of MySQL in your CI workflow, simplifying database initialization and integration tests. It is designed to be easy to use and customizable for your project needs.

Features

  • Installs MySQL server in your CI environment
  • Configures user, password, database, and port
  • Works on Linux, Windows, and macOS runners
  • Simple and quick integration into GitHub Actions workflows

Usage

Add the following step in your GitHub Actions workflow .yml file:

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup MySQL
uses: kayqueGovetri/setup-mysql@v1
with:
mysql_root_password: "rootpass"
mysql_database: "my_db"
mysql_user: "dev"
mysql_user_password: "devpass"
mysql_port: 3306

Inputs

NameDescriptionDefaultRequired
mysql_root_passwordPassword for MySQL root userrootYes
mysql_databaseName of the database to createtestNo
mysql_userDatabase user to createuserNo
mysql_user_passwordPassword for the database userpasswordNo
mysql_portPort for MySQL server3306No

Notes

  • Supported operating systems:

    • Linux (Ubuntu)
    • macOS 13 (Ventura), and 14 (Sonoma)
    • Windows (Windows Server, Windows 10/11 runners)
  • MySQL will be installed and configured according to the specified version.

  • The MySQL service may take a few seconds to become available after installation.

License

This project is licensed under the MIT License. See the LICENSE file for details.


← Back to projects