Skip to content

Instantly share code, notes, and snippets.

@brianmario
Created August 10, 2010 20:20
Show Gist options
  • Save brianmario/517914 to your computer and use it in GitHub Desktop.
Save brianmario/517914 to your computer and use it in GitHub Desktop.
diff --git a/railties/lib/rails/generators/rails/app/app_generator.rb b/railties/lib/rails/generators/rails/app/app_generator.rb
index a90f109..b345298 100644
--- a/railties/lib/rails/generators/rails/app/app_generator.rb
+++ b/railties/lib/rails/generators/rails/app/app_generator.rb
@@ -394,6 +394,7 @@ module Rails
when "postgresql" then "pg"
when "sqlite3" then "sqlite3-ruby"
when "frontbase" then "ruby-frontbase"
+ when "mysql" then "mysql2"
else options[:database]
end
end
diff --git a/railties/lib/rails/generators/rails/app/templates/config/databases/mysql.yml b/railties/lib/rails/generators/rails/app/templates/config/databases/mysql.yml
index ffc8a0a..241b6b4 100644
--- a/railties/lib/rails/generators/rails/app/templates/config/databases/mysql.yml
+++ b/railties/lib/rails/generators/rails/app/templates/config/databases/mysql.yml
@@ -1,21 +1,21 @@
# MySQL. Versions 4.1 and 5.0 are recommended.
#
-# Install the MySQL driver:
-# gem install mysql
+# Install the Mysql2 driver:
+# gem install mysql2
# On Mac OS X:
-# sudo gem install mysql -- --with-mysql-dir=/usr/local/mysql
+# sudo gem install mysql2 -- --with-mysql-dir=/usr/local/mysql
# On Mac OS X Leopard:
-# sudo env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
+# sudo env ARCHFLAGS="-arch i386" gem install mysql2 -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
# This sets the ARCHFLAGS environment variable to your native architecture
# On Windows:
-# gem install mysql
+# gem install mysql2
# Choose the win32 build.
# Install MySQL and put its /bin directory on your path.
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
- adapter: mysql
+ adapter: mysql2
encoding: utf8
reconnect: false
database: <%= app_name %>_development
@@ -32,7 +32,7 @@ development:
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
- adapter: mysql
+ adapter: mysql2
encoding: utf8
reconnect: false
database: <%= app_name %>_test
@@ -46,7 +46,7 @@ test:
<% end -%>
production:
- adapter: mysql
+ adapter: mysql2
encoding: utf8
reconnect: false
database: <%= app_name %>_production
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment