The missing action for MySQL 🎉
- Faster (with the default version) and simpler than containers
- Works on Linux, Mac, and Windows
- Supports different versions
Add it as a step to your workflow
- uses: ankane/setup-mysql@v1The default credentials are:
- user:
runneron Linux,rooton Mac,ODBCon Windows - password: none
- host:
localhostor socket - port:
3306
Specify a version
- uses: ankane/setup-mysql@v1
with:
mysql-version: 8.4Currently supports
| Version | 9.7 |
8.4 |
8.0 |
|---|---|---|---|
ubuntu-24.04 |
✓ | ✓ | default |
ubuntu-24.04-arm |
✓ | ✓ | default |
ubuntu-22.04 |
✓ | ✓ | default |
ubuntu-22.04-arm |
✓ | ✓ | default |
macos-26 |
✓ | default | |
macos-15 |
✓ | default | |
macos-15-intel |
✓ | default | |
macos-14 |
✓ | default | |
windows-2025 |
✓ | ✓ | default |
windows-2022 |
✓ | ✓ | default |
Test against multiple versions
strategy:
matrix:
mysql-version: [9.7, 8.4]
steps:
- uses: ankane/setup-mysql@v1
with:
mysql-version: ${{ matrix.mysql-version }}Create a database
- uses: ankane/setup-mysql@v1
with:
database: testdbSpecify a user
- uses: ankane/setup-mysql@v1
with:
user: testuserRun queries
- run: mysql -D testdb -e 'SELECT VERSION()'Install time zone support
- run: mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysqlEveryone is encouraged to help improve this project. Here are a few ways you can help:
- Report bugs
- Fix bugs and submit pull requests
- Write, clarify, or fix documentation
- Suggest or add new features