Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialDinesh kumar
5,061 Pointscan we use sqlite instead of mysql?
I am facing problem in creating the database using mysql ! can I continue Active Record Basics using sqlite as database?
1 Answer
Jerome Doyle
8,855 PointsYes! (I am not really good, but I am trying to answer you!) In your config/database.yml
change your code to the code below.
# SQLite version 3.x
# gem install sqlite3
#
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
#
default: &default
adapter: sqlite3
pool: 5
timeout: 5000
development:
<<: *default
database: db/development.sqlite3
# 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:
<<: *default
database: db/test.sqlite3
production:
<<: *default
database: db/production.sqlite3
Christian Espinoza
4,163 PointsWhat would be the sqlite version of mysql -uroot????
Christian Espinoza
4,163 Pointsas in how do I follow along with the Sqlite version of what he is doing on the command line?
JoJo KoKo
4,712 PointsJoJo KoKo
4,712 PointsActiveRecord does support SQLite as well.