brianmario / mysql2

A modern, simple and very fast Mysql library for Ruby - binding to libmysql
http://github.com/brianmario/mysql2
MIT License
2.25k stars 550 forks source link

Mysql2::Error: Unknown database 'test_tester' (Mysql2::Error) | Rails 7.1.2/Ruby 3.2.2 #1343

Closed RailsCod3rFuture closed 10 months ago

RailsCod3rFuture commented 10 months ago

I can no longer create databases with rails 7.1.2 and ruby 3.2.2. Does anyone have a fix for this bug? I'm using Psyche < 4 right now and its still not loading the database.yml file correctly.

sodabrew commented 10 months ago

Are you confident that the database does exist? Is there an error message indicating that the config file was not loaded? If so, you may find more help asking on a Rails forum as the config files are not specific to this gem.

RailsCod3rFuture commented 10 months ago

This happens after running bin/rails db:create RAILS_ENV=test. rake aborted! ActiveRecord::NoDatabaseError: We could not find your database. Available database configurations can be found in config/database.yml file.

database.yml

test: &test
 << *default
 database: web-app-test
 socket: /tmp/mysql.sock
RailsCod3rFuture commented 10 months ago

When I remove the &test portion. A psyche error appears. Psyche::BadAlias: Unknown alias: test (Psych::BadAlias)

RailsCod3rFuture commented 10 months ago

It was something badly configured in another gem.