when I try to navigate to http://localhost:3000 after the 4.3 change
I get the error : ActiveRecord::ConnectionNotEstablished
and I don't know how to solve it
the database.yml file is:
adapter => mysql
host => 127.0.0.1
database => blog
username => root
password => *****
my gems:
rails 3.1.3
activerecord 3.1.3
mysql 2.8.1
I am trying the tutorial in:
Getting Started with Rails — Ruby on Rails Guides
when I try to navigate to http://localhost:3000 after the 4.3 change
I get the error : ActiveRecord::ConnectionNotEstablished
and I don't know how to solve it
the database.yml file is:
adapter => mysql
host => 127.0.0.1
database => blog
username => root
password => *****
Did rake db:create that you did earlier succeed. I note that you are
using mysql rather than sqlite, is that intentional?
Can you access the db via your mysql server by other means?
I think you should probably specify mysql2 as the adaptor in
database.yml. At least that is what I have.
Can you repeat rake db:create and copy/paste the complete command line
and the results here. Then do the same for rake db:migrate.
If those work then start the server and browse to
http://localhost:3000 and show the complete output from the server
window, except you can just show the start of the stack trace if it is
the same as above. It is a lot less annoying to have too much
information than it is to have to keep going back and asking for more.
I am not sure you should have told us the password. I thought you
said you had switched to mysql2. The above says you are using mysql.
Try again with mysql2. Don't just say it makes no difference, post
the result again.
Also have you have confirmed that the database has been created? You
can do this using mysql command line.
It was just a copy/paste error, and I change it as fast as possible
please erase the part of the pwd
else I try it too with mysql2 and I had the same message
I create the db manually with Mysql workbench
regards,
It was just a copy/paste error, and I change it as fast as possible
please erase the part of the pwd
Too late, it is distributed around the internet now, there is no way
of deleting it. I suggest you change the password and if you have
used that password for anything else then you change it there too.
Quickly.
else I try it too with mysql2 and I had the same message
It is impossible that it had exactly the same message. I specifically
asked that you don't just say that it made no difference, I asked that
you post the result again. I cannot help unless you provide all the
information I ask for.
I create the db manually with Mysql workbench
regards,
It is a pity you did not mention that before. When you said that rake
db:create worked ok then that suggests that it successfully created
the database, but now you are telling me that you did not create the
db that way. At the start you said you were working through a
tutorial, did it not tell you to create the db using rake db:create?
I think you should remove the database and see if rake db:create will
create it. If not then post the result here. Is there anything else
of possible significance that you have not told us?
I dropped the schema blog, I change the pwd and I change the adapter
like this:
development:
adapter: mysql2
encoding: utf8
database: blog_dev
pool: 5
username: root
password:
socket: /tmp/mysql.sock
I execute rake db:create and I get the following error stack:
The file is the file Gemfile in the root of your rails project (this
file is mentioned in the tutorial). I think maybe you would be best
to follow the tutorial /exactly/ for the moment, rather than trying to
use mysql. Then when you have worked through that simple one go on to
railstutorial.org (which is free to use online) which will introduce
you to more concepts and techniques, rather than hoping for people
here to help with every little issue you have.
I changed the gem file and succeeded with the db:create and created the
three databases only for once after that I can't use any of my mysql
database connections not only in ror applications
the message is : Access denied for user 'root'@'localhost' (using
password: YES) (Mysql::AccessDeniedError)
I am using ruby on windows
this is an example of a database connection
ActiveRecord::Base.establish_connection(
:adapter => "mysql",
:host => "127.0.0.1",
:database => "database",
:username => "root",
:password => "*********"
)