Create a new Ruby on Rails application using MySQL instead of SQLite

前端 未结 19 1245
难免孤独
难免孤独 2020-12-04 05:46

I want to create my Rails application with MySQL, because I like it so much. How can I do that in the latest version of Rails instead of the default SQLite?

19条回答
  •  Happy的楠姐
    2020-12-04 06:12

    If you are using rails 3 or greater version

    rails new your_project_name -d mysql
    

    if you have earlier version

    rails new -d mysql your_project_name
    

    So before you create your project you need to find the rails version. that you can find by

    rails -v
    

提交回复
热议问题