Ruby on Rails - consider we are connecting mysql rds with our rails application in ruby on rails - ruby on rails tutorial - rails guides - rails tutorial - ruby rails



Steps to create MYSQL database

  • Login to amazon account and select RDS service
  • Select Launch DB Instance from the instance tab
  • By defaul MYSQL Community Edition will be selected, hence click the select button
  • Select the database purpose, say production and click next step
  • Provide the mysql version, storage size, DB Instance Identifier, Master Username and Password and click next step
  • Enter Database Name and click Launch DB Instance
  • Please wait until all the instance gets created. Once the instance gets created you will find an Endpoint, copy this entry point (which is referred as hostname)

Installing connectors

Add the MySQL database adapter to your project's gemfile,

gem 'mysql2'
Clicking "Copy Code" button will copy the code into the clipboard - memory. Please paste(Ctrl+V) it in your destination. The code will get pasted. Happy coding from Wikitechy - ruby on rails tutorial - rails guides - ruby rails - rubyonrails - learn ruby on rails - team

Install our added gems,

bundle install
  • Some other database adapters are,
    • gem 'pg' for PostgreSQL
    • gem 'activerecord-oracle_enhanced-adapter' for Oracle
    • gem 'sql_server' for SQL Server

Configure your project's database.yml file Open your config/database.yml file

production:
  adapter: mysql2
  encoding: utf8
  database: <%= RDS_DB_NAME %>  # Which you have entered you creating database
  username: <%= RDS_USERNAME %> # db master username
  password: <%= RDS_PASSWORD %> # db master password
  host: <%= RDS_HOSTNAME %>     # db instance entrypoint
  port: <%= RDS_PORT %>         # db post. For MYSQL 3306

This ruby on rails tutorial page provides you the following key areas such as ruby , rail , ruby on rails , rail forum , ruby on rails tutorial , ruby tutorial , rails guides , rails tutorial , learn ruby , rails form_for , ruby rails , ruby class , what is ruby on rails , rails installer , ruby online , learn ruby on rails , ruby on rails jobs , rails find_by , install rails , easyrail , rubyonrails , link_to rails , ruby on rails developer , learn ruby the hard way , railscasts , ruby on rails examples , ruby on rails vs php , rails 4 , rails activerecord , rails generate , ruby and rails , ruby on rails download , install ruby on rails , ruby net http , what is rails , ruby app , ruby vs ruby on rails , ruby on rails windows , rails for zombies , ruby on rails book , ruby on rails development , ruby on rails ide , ruby on rails tutorial pdf

Related Searches to consider we are connecting mysql rds with our rails