rails and mysql

0 views
Skip to first unread message

Guo Yangguang

unread,
Jun 20, 2008, 12:14:18 PM6/20/08
to rubyonra...@googlegroups.com
Hello:

I have been used to mysql.But how to install it with rails 2.1? I can
find many instructions for sqlite with rais2.1 except mysql.
--
Posted via http://www.ruby-forum.com/.

Michael Breen

unread,
Jun 20, 2008, 12:19:06 PM6/20/08
to rubyonra...@googlegroups.com
To create a rails app that uses mysql instead of the default of sqlite
you can run the command "rails myappsname -d mysql"

(this assumes you have mysql installed)

Best.
Mike

Guo Yangguang

unread,
Jun 20, 2008, 1:25:43 PM6/20/08
to rubyonra...@googlegroups.com
Michael Breen wrote:
> To create a rails app that uses mysql instead of the default of sqlite
> you can run the command "rails myappsname -d mysql"
>
> (this assumes you have mysql installed)
>
> Best.
> Mike

thank you!But i do not know how to install the mysql.just download it
and install it or need some gem?

haries

unread,
Jun 20, 2008, 1:31:24 PM6/20/08
to Ruby on Rails: Talk
mysql should be downloaded and installed
There is a mysql driver that should be installed as well.


On Jun 20, 10:25 am, Guo Yangguang <rails-mailing-l...@andreas-s.net>
wrote:

heimdull

unread,
Jun 20, 2008, 1:42:07 PM6/20/08
to Ruby on Rails: Talk
Driver?

Install MySQL separate using either the installer for Windows or rpm/
source if you are on a unix system. Make sure mysql is working and is
listening to a port that you can connect to. (like 3306)

Either create a new rails project with -d mysql or edit your confg/
database.yml to look like this:

development:
adapter: mysql
encoding: utf8
database: database_devel
username: root
password:
port: 3306

By default there is a ruby driver that is installed WITH rails so
there is no need to install anything to get MySQL working with rails.
There is a NATIVE gem that you can install to get better performance
for MySQL and this is recommended for production .... Something like
this:

gem install mysql -- --with-mysql-config (if mysql is in your path)

Guo Yangguang

unread,
Jun 20, 2008, 9:04:10 PM6/20/08
to rubyonra...@googlegroups.com


Thank you!I should be able to resolve it.

Kennyroo

unread,
Jun 21, 2008, 12:55:31 PM6/21/08
to Ruby on Rails: Talk
Have you been able to resolve the problem?

On Jun 20, 6:04 pm, Guo Yangguang <rails-mailing-l...@andreas-s.net>
wrote:
Reply all
Reply to author
Forward
0 new messages