I am building a virtual environment by building an environment with docker + rails + mysql.
Link content
It's a bit long because I made it referring to the above-mentioned yutube, but if you have time, I think it will be easier to understand if you can see it.
I think there are many points that are lacking in explanation or difficult to understand, but if i am familiar with this, I would appreciate your advice.
When I did docker-compose up, Unknown database'myapp_development' appeared on the browser side, so I made docker-compose run web rails db: create as explained in the video attached to the link, but db was created due to the following error I could not do it.
$docker-compose run web rails db:create
Mysql2::Error: Can't create database'myapp_development' (errno: 1438434304): CREATE DATABASE `myapp_development` DEFAULT CHARACTER SET `utf8`
Couldn't create'myapp_development' database. Please check your configuration.
rails aborted!
ActiveRecord::StatementInvalid: Mysql2::Error: Can't create database'myapp_development' (errno: 1438434304): CREATE DATABASE `myapp_development` DEFAULT CHARACTER SET `utf8`
~~~
~~~
What I tried
I googled a lot and tried the following.
1. Start mysql
→ It is started and started normally, but the same error appears even if docker-compose run web rails db: create again.
2. Reinstall mysql
→I was able to install it by brew install [email protected] but this also gives the same error
3,Link content
I thought that I should refer to the second link above, but I have not decided because it is really good for this process because it is a beginner
It is the situation.
I'm sorry for the difficult text, but if i am familiar with this, I would appreciate your help.
macbook air
mac Os catalina
ruby 2.5.8
bundle 2.1.4
-
Answer # 1
Related articles
- about building a latex environment for vscode
- about building a vpn environment
- error while building environment on ubuntu of ruby on rails
- nodejs - about building react environment with create-react-app
- python - the error in building the environment to run pose estimation cannot be resolved
- about building mysql ndb cluster
- local environment construction about installation of mac mysql
- error in building environment of ruby on rails
- ruby - about error of update action when nesting
- mysql - database connection error with local third xampp, wordpress installation
- javascript - about roulette creation error
- mysql - command error improvement
- python - about the error cannot reshape array of size
- python environment construction error macosx
- docker, nginx, php, mysql environment construction
- java - error when building android studio ml kit for firebase [plugin with id'comandroidapplication' not found]
- python - docker environment construction error
- i get an error when building in android studio
- i want to build an express + mysql environment on docker, but i can't connect to mysql within the launched app error: connect ec
- i get an error when i try to install mysql with bundle install [ruby on rails]
- mysql - i want to recreate rails db from scratch
- mysql - about $docker exec -it container name/bin/bash of docker
- ruby - [docker environment] how to deal with errors during rails db: migrate
- mysql - questions about docker errors
- ruby - [i'm having trouble with an error] cannot add foreign key constraint
- ruby - unable to create table with foreign key
- import sql file into docker mysql
- data in public is not reflected in docker * rails * nginx
- mysql - i can't db: migrate when deploying a rails app on heroku
- ruby - i want to display new posts i made on the top page only for myself
Apparently it was because mysql was not connected in the local environment and the virtual environment. I should have read the error message carefully.