Skip to content
项目

shogo82148/actions-setup-mysql

在 GitHub 查看

关于

The distribution. The valid values are mysql or mariadb. The default value is mysql.

数据

这些数字如何统计

实测星标增长

24小时
0
7天
0
15天
正在收集历史
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

actions-setup-mysql

This action sets up a MySQL database for use in actions by:

  • download a version of MySQL or MariaDB
  • start mysqld

Motivation

Usage

steps:
  - uses: actions/checkout@v4
  - uses: shogo82148/actions-setup-mysql@v1
    with:
      mysql-version: "8.4"
  - run: mysql -uroot -e 'SELECT version()'

Configuration

mysql-version

The version of MySQL or MariaDB.

Available Versions are:

  • MySQL
    • 26.10 (latest)
    • 26.7
    • 9.7 (LTS)
    • 8.4 (LTS)
    • 8.0
  • MariaDB
    • 12.3 (latest)
    • 11.8 (LTS)
    • 11.4 (LTS)
    • 10.11 (LTS)

distribution

The distribution. The valid values are mysql or mariadb. The default value is mysql.

You can use mysql- and mariadb- prefixes in mysql-version instead of the distribution input. For example, the following two workflows install MariaDB 12.3.

- uses: shogo82148/actions-setup-mysql@v1
  with:
    distribution: "mariadb"
    mysql-version: "12.3"
- uses: shogo82148/actions-setup-mysql@v1
  with:
    mysql-version: "mariadb-12.3"

auto-start

If it is true, the action starts the MySQL server. If it is false, the action doesn't start the MySQL sever. You need to execute the mysqld command yourself.

The default value is true.

my-cnf

my.cnf settings for mysqld. It uses the same syntax as my.cnf.

Example:

- uses: shogo82148/actions-setup-mysql@v1
  with:
    mysql-version: "8.4"
    my-cnf: |
      innodb_log_file_size=256MB
      innodb_buffer_pool_size=512MB
      max_allowed_packet=16MB
      max_connections=50
      local_infile=1

root-password

The password for the root user.

user

The name of the new user.

password

The password for the new user.

Outputs

base-dir

The directory under which the mysql database is being created.

It contains:

  • etc/my.cnf
  • tmp/mysqld.log
  • tmp/mysqld.pid
  • tmp/mysql.sock
  • var: The default path of datadir
  • var/ca.pem: The root certificate of the certification authority for SSL/TLS
  • var/server-cert.pem: The server certificate for SSL/TLS
  • var/server-key.pem: The server key for SSL/TLS

Here are some examples:

- id: setup-mysql
  uses: shogo82148/actions-setup-mysql@v1
  with:
    mysql-version: "8.4"

- name: connect via unix domain socket
  run: mysql -uroot \
    --protocol=SOCKET \
    --socket=${{ steps.setup-mysql.outputs.base-dir }}/tmp/mysql.sock
    -e 'SELECT version()'

- name: configure the root certificate for connecting via SSL/TLS.
  run: mysql -uroot \
    --ssl --ssl-mode=REQUIRED \
    --ssl-ca=${{ steps.setup-mysql.outputs.base-dir }}/var/ca.pem \
    -e 'SELECT version()'

Environment Values

MYSQL_HOME

The path to the directory in which the server-specific my.cnf file resides.

LIBMYSQL_PLUGIN_DIR

Directory in which to look for client plugins.

探索相关项目

加载中…