現在、SQLite3
をデータベースとして使用していて、PassengerとNginx経由のRailsアプリをLinode Ubuntu 10.04 Lucidボックスに送信する前に、MySQL
に切り替える必要があります。 。SQLite3からMySQLに切り替える必要があり、MySQLでデプロイしたい
linode ubuntu 10.04ボックスにmsqlサーバを設定し、rootユーザのパスワードを設定します。 database.yml
の設定方法を教えてください。このMySQL
データベースを設定する手順は何ですか? mysql2
gemがインストールされており、Gemfileにあります。
MySQL
をデプロイするには、database.yml
のように見える必要がありますか。
データベースにdatabase name
のような特定の名前が必要ですか?
私たちのマシンでrake db:create
を実行するか、Ubuntuボックスで実行しますか?本番サーバーでdatabase.yml
# SQLite version 3.x
# gem install sqlite3
#
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
development:
adapter: sqlite3
database: db/development.sqlite3
pool: 5
timeout: 2000
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
adapter: sqlite3
database: db/test.sqlite3
pool: 5
timeout: 2000
production:
adapter: mysql2
encoding: utf8
database: production
pool: 5
username: root
password: "mysql password"
ええ、これらの接続テストは大変ありがとうございます。 –