Elastic Beanstalkで実行されているRailsアプリケーション用のAWS RDSを設定する際に問題が発生しました。私はthe docsを追跡しましたが、移行を実行しようとすると、MySQL構文エラーが発生します。移行がローカルで正常に動作し、ステージングを正常にセットアップしてエラーが最初の行にあるため、構文エラーがないことを確認してください。私はそれがトラフィックをブロックするセキュリティグループで行う必要があります考えていたが、私は適切に私のインバウンドルールを更新し、それでもエラーが出る:私は私の環境変数は、DBのために設定したAWSのRailsアプリケーションEB:移行が失敗する
3306 tcp 173.8.166.54/32, sg-3221b354 <- RDs Security Group
80 tcp 0.0.0.0/0, ::/0, sg-3b31a75d
22 tcp 0.0.0.0/0
443 tcp 0.0.0.0/0
。私は何が欠けていますか?
私は取得していますエラー:問題の最初の移行
Mysql2::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'json,
image
varchar(255),code
varchar(255),created_at
datetime NOT NULL,' at line 1: CREATE TABLEcoupons
(id
int AUTO_INCREMENT PRIMARY KEY,product
varchar(255),offer
varchar(255),size
varchar(255),description
varchar(255),info
json,image
varchar(255),code
varchar(255),created_at
datetime NOT NULL,updated_at
datetime NOT NULL) ENGINE=InnoDB /var/app/ondeck/db/migrate/20170725193230_create_coupons.rb:3:inchange' /opt/rubies/ruby-2.3.4/bin/bundle:22:in
load' /opt/rubies/ruby-2.3.4/bin/bundle:22:in<main>' ActiveRecord::StatementInvalid: Mysql2::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'json,
imagevarchar(255),
codevarchar(255),
created_atdatetime NOT NULL,' at line 1: CREATE TABLE
coupons(
idint AUTO_INCREMENT PRIMARY KEY,
productvarchar(255),
offervarchar(255),
sizevarchar(255),
descriptionvarchar(255),
infojson,
imagevarchar(255),
codevarchar(255),
created_atdatetime NOT NULL,
updated_atdatetime NOT NULL) ENGINE=InnoDB /var/app/ondeck/db/migrate/20170725193230_create_coupons.rb:3:in
change' /opt/rubies/ruby-2.3.4/bin/bundle:22:inload' /opt/rubies/ruby-2.3.4/bin/bundle:22:in
' Mysql2::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'json,image
varchar(255),code
varchar(255),created_at
datetime NOT NULL,' at line 1 /var/app/ondeck/db/migrate/20170725193230_create_coupons.rb:3:in `change'
移行の最初の行で発生します
class CreateCoupons < ActiveRecord::Migration[5.0]
def change
create_table :coupons do |t|
t.string :product
t.string :offer
t.string :size
t.string :description
t.json :info
t.string :image
t.string :code
t.timestamps
end
end
end
どのセキュリティグループでルールを表示していますか?インスタンス?またはRDS?あなたのRDSインスタンスまたはEBインスタンスのsecグループはsg-3221b354ですか? – strongjz
どのようなエラーが表示されますか? – Brian
@Brianがエラーで更新されました – BooBailey