mirromutth / mysql-action Goto Github PK
View Code? Open in Web Editor NEWGitHub Action to setup a MySQL database
License: MIT License
GitHub Action to setup a MySQL database
License: MIT License
I need to dump some data into the database. How do I do that?
I suggest we have an option called dump and put in the parameter of the dump file to import the database
Could I specify multiple database to be created and allowed by the user, such as
mysql database: ['some_test', 'some2_test']
or
mysql database:
- 'some_test'
- 'some2_test'
I need two database to be created but I can't figure out how.
Thank you for your extension, very helpful.
Hey @mirromutth! Thanks for all your work on this Action - I know a lot of us use it ๐
I can see there are a number of issues and PRs that would be good to resolve by merging some commits.
Would you be open to giving others access to the repo/transferring the repo elsewhere, in order to get some help with it?
I'd be willing to take over maintainership as we currently use my fork at Ghost.
I get this error when I try to setup a mysql instance in my Actions workflow. Any idea what I'm doing wrong?
docker: Error response from daemon: driver failed programming external connectivity on endpoint busy_mcnulty (e90f9b113c26a0772d43fe413b6c5755204a5459a16817a6ff398ca003a859ee): Error starting userland proxy: listen tcp 0.0.0.0:3306: bind: address already in use.
Here's my workflow:
jobs:
ruby:
name: Ruby Tests
runs-on: ubuntu-latest
steps:
- uses: zhulik/[email protected]
with:
redis version: "4"
- uses: mirromutth/[email protected]
with:
mysql version: "5.7.17"
mysql root password: "test"
- uses: actions/[email protected]
- name: Setup Ruby
uses: actions/[email protected]
with:
ruby-version: 2.5.5
- name: Install Dependencies
run: bundle install
- name: Setup Database
env:
RAILS_ENV: test
DATABASE_URL: mysql2://root:[email protected]/test
run: bundle exec rake db:create db:schema:load --trace
- name: Run Tests
env:
RAILS_ENV: test
DATABASE_URL: mysql2://root:[email protected]/test
run: bundle exec rspec
This is a bit offtopic, but someone here might know about this.
What are the credentials for the Default MySQL on Windows and macOS environments? The root:root
only seem to work on Linux.
In Docker Mysql options, there is an environment value MYSQL_ALLOW_EMPTY_PASSWORD
if this value is yes
, we can use root superuser without password.
But there are no options for empty password. If I set mysql root password: ''
, the action needs user and password
my config:
- uses: mirromutth/[email protected]
with:
mysql user: 'root'
mysql password: 'test'
but failed when I login with root and empty password
Hi there.
I'm getting access denied using the following config:
test:
runs-on: ubuntu-latest
steps:
- uses: mirromutth/mysql-action@master
with:
mysql version: '8.0'
mysql root password: rootpass
host port: 3889
container port: 3889
- run: mysql --port 3889 -u root -prootpass -e 'CREATE DATABASE IF NOT EXISTS test;'
The error is the following:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
Where did I go wrong? Thanks
I get this error from time to time:
SQLSTATE[HY000] [2006] MySQL server has gone away
I just re-run the job multiple times until it works.
This is my conf for MySQL setup:
- name: Setup MySQL
uses: mirromutth/[email protected]
with:
mysql database: test
mysql user: test
mysql password: test
Hi there,
I'm working on an Laravel project and wanted to start with GitHub Actions. Sadly I can't run the Actions because it always fails at the MySQL-Level with the following error
Syntax error or access violation: 1071 Specified key was too long; max key length is 3072 bytes
I googled a lot and everything that works for other people failed for me.
The weird part is that the column that is mentioned is only 1027 Bytes long. I don't think an index on this single column triples that. And in all other environments everything works fine.
I added Schema::defaultStringLength(191);
to the AppServiceProvider as mentioned in so many threads, changed the engine in the database config to InnoDB
and InnoDB ROW_FORMAT=DYNAMIC
tried to set the charset to utf8 instead if utf8mb4 and so on.
I don't really have any idea how I could get it to work.
I tried to import a SQL file:
mysql -h 127.0.0.1 -u admin -p123456789 < recovery.sql
but it returns "Lost connection to MySQL server at 'reading initial communication packet'" and I don't know what to do.
Some pointers would be appreciated. Thanks
Hello ๐,
First and foremost, I want to say a huge thank you ๐ for your work on mirromutth/[email protected]
. It has been an incredibly helpful tool that has greatly enhanced our workflow.
In using this action, I've noticed that the current configuration employs spaces in its property names, such as host port
, container port
, character set server
, collation server
, mysql version
, mysql database
, mysql root password
, mysql user
, mysql password
and so on.
- uses: mirromutth/[email protected]
with:
host port: 3800
container port: 3307
character set server: 'utf8'
collation server: 'utf8_general_ci'
mysql version: '8.0'
mysql database: 'some_test'
mysql root password: ${{ secrets.RootPassword }}
mysql user: 'developer'
mysql password: ${{ secrets.DatabasePassword }}
This is a bit unusual ๐ง when compared to most naming conventions in programming languages or configuration schemas and could potentially lead to confusion or errors. Additionally, we've found this to be a blocker ๐ง when trying to use sbt-github-actions
as it validates the YML based on these naming conventions.
Hence, I'd like to propose ๐ a small but significant improvement. Let's standardize the naming convention to something more common, like CamelCase (hostPort
, containerPort
, characterSetServer
, collationServer
, mysqlVersion
, etc.) or snake_case (host_port
, container_port
, character_set_server
, collation_server
, mysql_version
, etc.).
# Example in CamelCase
- uses: mirromutth/[email protected]
with:
hostPort: 3800
containerPort: 3307
characterSetServer: 'utf8'
collationServer: 'utf8_general_ci'
mysqlVersion: '8.0'
mysqlDatabase: 'some_test'
mysqlRootPassword: ${{ secrets.RootPassword }}
mysqlUser: 'developer'
mysqlPassword: ${{ secrets.DatabasePassword }}
# Example in snake_case
- uses: mirromutth/[email protected]
with:
host_port: 3800
container_port: 3307
character_set_server: 'utf8'
collation_server: 'utf8_general_ci'
mysql_version: '8.0'
mysql_database: 'some_test'
mysql_root_password: ${{ secrets.RootPassword }}
mysql_user: 'developer'
mysql_password: ${{ secrets.DatabasePassword }}
Switching to a more standardized configuration property naming could pave the way for a more intuitive and consistent developer experience ๐.
Thank you ๐ for your effort on this action, and I'm convinced these changes would go a long way in enhancing its usability and the overall developer experience.
Thank you for considering this proposal ๐. I'm eagerly looking forward to your thoughts on this.
Best regards,
Tushar
my project's unit-test will write data to MySQL, how to create table according to DDL.sql
file?
ๆ็้กน็ฎ่ทๅๆต็ๆถๅไผๅพDB้ๅๆฐๆฎ๏ผๆไน้่ฟ้กน็ฎ้็DDL.sqlๆไปถๆฅๅปบ่กจๅข๏ผ็ฐๅจactionๆง่ก่ตทๆฅไผๆฅ้
After setting up MySQL using this action,
I still cannot connect to mysql server.
Also, I checked the ports using like netstat -tnlp
There is no opened ports for MySQL.
In my django project, this error is occurred. (2003, "Can't connect to MySQL server on '0.0.0.0' (111)
What option do I need to pass to make it create the database user with identified with mysql_native_password BY _PASSWORD_
?
If it's not a feature, can it be added, please?
Thanks
Hello,
I am trying to use your action, but the database isn't created.
Is use the following config:
- uses: mirromutth/[email protected]
with:
host port: 3800 # Optional, default value is 3306. The port of host
container port: 3307 # Optional, default value is 3306. The port of container
character set server: 'utf8' # Optional, default value is 'utf8mb4'. The '--character-set-server' option for mysqld
collation server: 'utf8_general_ci' # Optional, default value is 'utf8mb4_general_ci'. The '--collation-server' option for mysqld
mysql version: '8.0' # Optional, default value is "latest". The version of the MySQL
mysql database: 'test' # Optional, default value is "test". The specified database which will be create
mysql root password: 'root' # Required if "mysql user" is empty, default is empty. The root superuser password
mysql user: 'root' # Required if "mysql root password" is empty, default is empty. The superuser for the specified database. Of course you can use secrets, too
mysql password: 'root' # Required if "mysql user" exists. The password for the "mysql user"
I get the following error further in the process:
SQLSTATE[HY000] [1049] Unknown database 'test' (SQL: select * from information_schema.tables where table_schema = test and table_name = system_models and table_type = 'BASE TABLE')
Any idea?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.