rails and mysql

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.

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

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?

mysql should be downloaded and installed There is a mysql driver that should be installed as well.

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)

heimdull wrote:

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)

Thank you!I should be able to resolve it.

Have you been able to resolve the problem?