First of all, what I know about Rails DB is that sqlite is used.
Regarding DB, I felt like it would be overwhelming with sqlite after launching an actual service.
Working with the Web Server-Application Server (Nginx + Passenger)
I want to change DB work to mysql.
I'm asking you this question because I don't have a clue about the overall work process.
First of all, I found the posting on the instance where Ruby and Rails are installed
Instead of sqlite, they installed mysql by themselves
In my case, AWS provides services related to DB
You want to use Relational Database Services (RDS), a relational database service.
In the case of this RDS, it seems to be linked outside the EC2 instance where Rails, Ruby, etc. are installed.
Then, how can I change the settings of the Rails installed in the EC2 instance?
For example, as soon as you enter a Gem file, annotate sqlite, and install mysql bundle,
Can you link the EC2 instance with the RDS?
ruby-on-rails aws mysql
Development and production are called stages. Usually, development is used for development, and production is used for real service. As the service grows, alpha, beta, etc. will be added separately.
When developing it, it is convenient to install and use mysql on your PC, so you can do it like the example, and when you turn the service, you can add it to the production setting. If the DB is external, such as RDS, you can assign the RDS domain to host
.
development:&default
adapter: mysql2
encoding: utf8
database: test_development
pool: 5
username: root
password:
socket: /tmp/mysql.sock
production: &production
<<: *default
host: xxxxxxxxxxxxxxxxxxxx.rds.amazonaws.com
username:
password:
database: test_production
First of all, I found a RDS connection question in the hash code here I will refer to it and write each item including the host item in the database.yml file I'm doing it.
I'm going to ask you a few questions here
He told me that if DB is outside like RDS, you can designate RDS domain as host, but when I tried it, I wondered if I was using it correctly;;; So I'm asking for your help with the capture image.
© 2024 OneMinuteCode. All rights reserved.