Up to now, I used PostgreSQL to deploy to the database in the database, but if it is heroku, the mysterious phenomenon that the posted image disappears after a certain time occurs.
That’s why I decided to deploy it on AWS and change the database to MySQL, so I will try it.
I have already installed MySQL. If you haven’t already, please install it.
gem'mysql2' to the Gemfile.
default: &default adapter: mysql2 encoding: utf8 username: root password:
database.yml and rewrite.
If you are installing it for the time being when learning somewhere like me, I think that you probably have not set the password as the root user, so add
username: root and
password: at this time. ..
If you have created a user and want to log in, I think that it is better to enter the username and password. (maybe)
$ bundle install
$ bundle exec rake db:create
Create a database
$ rails db:migrate
Don’t forget this command!
It is not particularly difficult when I actually try it, but I thought that if I do not understand it I might be crazy. (Because I was addicted)
It seemed difficult to change the DB from the perspective of a beginner, but it was unexpectedly smooth, so it is important to challenge!