Change DB from SQLite to MySQL

Introduction

After making a model, migrating, and checking the DB with Sequel Pro

I don't have the database I intended to create! Since it became, I will post the remedy as a memorandum.

Solution

After dealing with it by referring to the article of here, the solution was reached.

What i did

Modify gemfile

This is a rudimentary mistake, but comment out the selected part of the image below (SQLite3 in the gemfile). スクリーンショット 2020-10-12 6.06.03.png

At the terminal

bundle install --without production

Because I need to make a DB

bundle exec rake db:create

And was this necessary? Maybe it wasn't necessary because I was already doing it

rails db:migrate

did it

You can now check the database on Sequel Pro. スクリーンショット 2020-10-12 6.18.21.png

Recommended Posts

Change DB from SQLite to MySQL
Change from SQLite3 to PostgreSQL
DataSource connection from WebSphere to MySQL (DataSource property change?)
[Ruby on Rails] From MySQL construction to database change
Upgrade from MYSQL5.7 to 8.0 on CentOS 6.7
Rails DB PostgreSQL changed to MySQL
Update MySQL from 5.7 to 8.0 with Docker
How to change from HTML to Haml
Connect from Java to MySQL using Eclipse
Job change from SIer to Web engineer
Change from SQLite3 to PostgreSQL in a new Ruby on Rails project
Connect to Aurora (MySQL) from a Java application
How to dump from database (DB) to seeds file
Procedure to change lower_case_table_names = 1 in MySQL 8.0 of CentOS 8.3
[Rails MySQL] How to reset DB on heroku
I want to write quickly from java to sqlite
Select * from Java SDK to Azure Cosmos DB
Changes from Java 8 to Java 11
Sum from Java_1 to 100
Migrate from JUnit 4 to JUnit 5
Change the database (MySQL) primary key to any column.
How to change from Oracle Java 8 to Adopt Open JDK 9
[Beginner] How to use devise Change settings from introduction
How to install MySQL
I want to connect to Heroku MySQL from a client
[JDBC] I tried to access the SQLite3 database from Java.
Change only one character from the String type string to uppercase
When you want to change the MySQL password of docker-compose
Try Spring Boot from 0 to 100.
Migration from Cobol to JAVA
Switch from slim3-gen to slim3-gen-jsr269
Moving from AWS to PaizaCloud
Randomly select 100 records from DB
New features from Java7 to Java8
Migrating from vargrant to docker
Connect from Java to PostgreSQL
Connect to DB with Java
Connect to MySQL 8 with Java
Convert from ○ months to ○ years ○ months
Rewriting from applet to application
[Android] Connect to MySQL (unfinished)
From Ineffective Java to Effective Java
How to migrate from JUnit4 to JUnit5
I can't log in to MySQL from Django when using docker-compose
SQL to get table list (Oracle / MySQL / PostgreSQL / SQLite / SQLServer / Cassandra)
02. I made an API to connect to MySQL (MyBatis) from Spring Boot
Change Spring Boot REST API request / response from CamelCase to SankeCase
If you want to change the Java development environment from Eclipse
[Rails / Heroku / MySQL] How to reset the DB of Rails application on Heroku