Check you password in database.yml. Also, make sure you actually have a
root
user in mysql.
On Tue, Jul 29, 2008 at 11:57 PM, Joey Boy
<rails-mailing-list@andreas-s.net
hello!
thank you. i'm 101% about the password, and i do have root account in
mysql. i actually created another account with same user as the db.
hoping rails was expecting that. but..apparently..i'm wrong..
Craig White wrote:
>> same user and password in database.yml.
> ----
> sounds like when you connected to mysql from command line, it used
> sockets but your setup in database.yml is using port 3306 which actually
> is different.
>
> You probably want to figure out where the socket is, enter that in
> database.yml and comment out the port...
>
> stuff removed for clarity...
> # ps aux|grep mysql.sock
> root 8017 0.0 0.0 4524 224 pts/1 S Jul27
> 0:00 /bin/sh /usr/bin/mysqld_safe --socket=/var/lib/mysql/mysql.sock
>
> thus I would want to add to database.yml...
> socket: /var/lib/mysql/mysql.sock
>
> Craig
Craig White wrote:
>> >
>> hi!
>>
>> how do you do the same with windows?
> ----
> Oh - Windows...don't use sockets
>
> Can you connect from command line like...
>
> mysql YOUR_DATA_BASE -Uroot -p
>
> ?
>
> Craig
Rails doesn’t expect anything, it only passes the user and password as you write them in database.yml.
So, if this user doesn’t exist in mysql, it won’t connect. If the password doesn’t match the correct one it won’t connect also (obviously), if the user doesn’t have the perms to read this database, it will return an not authorized message or something in the lines.
The problem is its not getting mysql path with that use name &
password..Do onething while creating project use following instruction
rails project_name -d mysql
It will create database.yml file with mysql path...
hi!
that's what i did. i generate a new app and copied the database.yml file
over the problematic one. that fixed it.