-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trilogy adapter not working with DATABASE_URL
config in GitHub actions
#64
Comments
I speculate the problem is related to an issue in the I had to make these changes to use the adapter on GitHub CI. Essentially you need to ensure the user is run: |
sudo service mysql start
mysql -e 'CREATE DATABASE ${{ env.DB_DATABASE }};' -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }}
+ mysql -e "CREATE USER 'test'@'localhost' IDENTIFIED WITH mysql_native_password BY 'test';" -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }}
+ mysql -e "GRANT ALL PRIVILEGES ON *.* TO 'test'@'localhost' WITH GRANT OPTION;" -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }}
+ mysql -e "FLUSH PRIVILEGES;" -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} |
@gstark thanks for the snippet! You're creating a new user ( |
Yes, in my setup, I am manually setting |
I didn't end up getting this working (had to move on to other things) but hope I can come back at some point and get it going! |
Hi there,
I'm in the process of moving a Rails 7 app over to Trilogy and whilst locally everything Just Worked using
database.yml
orDATABASE_URL
as a config I'm getting an error when using theDATABASE_URL
env variable in Github actions for CI. Previously I had themysql2
adapter working fine on GA usingDATABASE_URL
.The error I'm seeing is
Trilogy::QueryError: trilogy_auth_recv: TRILOGY_UNEXPECTED_PACKET
.I'm not using any specific config options on the CI mysql service but locally I am starting up the docker compose service with the following, in case that makes a difference
command: [ "--default-authentication-plugin=mysql_native_password", "--character-set-server=utf8mb4", "--collation-server=utf8mb4_unicode_ci", "--innodb_monitor_enable=all" ]
I'm using the latest versions of
trilogy
,active record-trilogy-adapter
andrails
.The output I get from the GA CI run is as follows;
Any help would be greatly appreciated!
The text was updated successfully, but these errors were encountered: