Unable to change the database

Hi All,

I have started to learn RoR couple of days back. I am using Aptana
editor for Rails.

I created a new project called users and the database called
users_development. I have added the controller called which is
working. Now I am trying to change the DB from users_development to
scraping_development. I edited the database.yml file from
users_development to scraping_development. Now I tried to run my login
controller. But it is not running it is throwing an error saying that
‘Unknown database scraping_development’.

Can somebody please help me to resolve this problem. I am totally
halted with this problem…

Thanks,
Ramu.

Hey Ram,

One YML can hook one DB only.In order to commnicate with Multiple DB’s U
need to use Establish_connection of Active Record.

  • RajKishan

On Sun, Jul 27, 2008 at 3:44 PM, RAMU [email protected] wrote:

users_development to scraping_development. Now I tried to run my login


Happiness keeps u Sweet, Trials keep u Strong, Sorrow keeps u Human,

Failure Keeps u Humble, Success keeps u Glowing, But only God Keeps u

Going…

Keep Going…

I want to change the Db from users_development to
scraping_development. I dont want my application point to 2 databases.
I want to connet to scraping_development only. Can you please reply me
how I can do that??

cool.Do like this

Forst Specify users_development in DataBase.yml

and in the Model or any where you want to Use 2nd DB please try with
establish_connection() for 2nd DB.I know i am confucing you a bit please
read here you will get an idea.

http://scour.com/view/result/?URL=http://api.rubyonrails.org/classes/ActiveRecord/Base.html

and read for that method.I hope this would help.

  • RajKishan

On Sun, Jul 27, 2008 at 3:53 PM, [email protected]
[email protected]wrote:

need to use Establish_connection of Active Record.

editor for Rails.
halted with this problem…

Keep Going…


Happiness keeps u Sweet, Trials keep u Strong, Sorrow keeps u Human,

Failure Keeps u Humble, Success keeps u Glowing, But only God Keeps u

Going…

Keep Going…

I thought you were working on Distributed DB’s.

Then Remove it from YML and place new one.Very simple.

On Sun, Jul 27, 2008 at 4:22 PM, [email protected]
[email protected]wrote:

On Jul 27, 3:35 pm, “Rajeshwar Mothe” [email protected] wrote:

and read for that method.I hope this would help.

I want to change the Db from users_development to

users_development. I have added the controller called which is

Keep Going…


Happiness keeps u Sweet, Trials keep u Strong, Sorrow keeps u Human,

Failure Keeps u Humble, Success keeps u Glowing, But only God Keeps u

Going…

Keep Going…

I am not able to see any thing in the below link??

and I have one more question. anyway I am not going to use database
“users_development” so why should not I remove the DB entry from the
database.yml file???

Could you please help me in this?? I am helpless

I did the same it is not working. It is saying Unknown database

Which DB you are Using ? Is it MYSQL
probably Adapter needs to be changed from default sqlLite to Mysql

On Sun, Jul 27, 2008 at 4:29 PM, [email protected]
[email protected]wrote:

Could you please help me in this?? I am helpless

my

Thanks,


Happiness keeps u Sweet, Trials keep u Strong, Sorrow keeps u Human,

Failure Keeps u Humble, Success keeps u Glowing, But only God Keeps u

Going…

Keep Going…


Happiness keeps u Sweet, Trials keep u Strong, Sorrow keeps u Human,

Failure Keeps u Humble, Success keeps u Glowing, But only God Keeps u

Going…

Keep Going…

I am using mysql and the 2 DBs are there in mysql only

RAMU wrote:

I created a new project called users and the database called
users_development. I have added the controller called which is
working. Now I am trying to change the DB from users_development to
scraping_development. I edited the database.yml file from
users_development to scraping_development. Now I tried to run my login
controller. But it is not running it is throwing an error saying that
‘Unknown database scraping_development’.

It is correctly telling you the mysqld (which is outside the editor) has
no
database with that name.

I often create new databases with this magical hack:

echo create database scraping_development; | mysql -u root

If that causes any trouble, just run mysql -u root (or a graphical mysql
administrator) to create a database with that name.


Phlip

Hey Check probably DB name had a Typo :frowning:

On Sun, Jul 27, 2008 at 4:46 PM, [email protected]
[email protected]wrote:

On Sun, Jul 27, 2008 at 4:22 PM, [email protected] <

Could you please help me in this?? I am helpless
please
[email protected]

On Jul 27, 3:19 pm, “Rajeshwar Mothe” [email protected]

On Sun, Jul 27, 2008 at 3:44 PM, RAMU [email protected]
called
saying


Failure Keeps u Humble, Success keeps u Glowing, But only God Keeps u

Going…

Keep Going…


Happiness keeps u Sweet, Trials keep u Strong, Sorrow keeps u Human,

Failure Keeps u Humble, Success keeps u Glowing, But only God Keeps u

Going…

Keep Going…

Rajeshwar Mothe wrote:

and in the Model or any where you want to Use 2nd DB please try with
establish_connection() for 2nd DB.I know i am confucing you a bit please
read here you will get an idea.

Please read the question again!