From the course: Ruby on Rails 5 Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Create a database

Create a database - Ruby on Rails Tutorial

From the course: Ruby on Rails 5 Essential Training

Start my 1-month free trial

Create a database

- [Josh] If we're going to use a databse with our Rails application, then of course, we need to have one created first. If you've been following along with me, then you already created your database back in chapter two when we configured our project. Let's do a quick review of the process. There are four useful SQL commands that you should learn. Show databases, which shows a list of all the databases inside my SQL. Create database, followed by the name of the database we want to create. Use, and then the name of the database we want to use. That's especially useful for switching between databases. And then, drop database, with the name of the database we want to drop or completely remove. And that removes the database and all tables associated with it. Earlier we did create database and we created two databases. Simple CMS development and simple CMS test. That created database containers, but there's no tables on those databases yet. It's a best practice not to connect to our…

Contents