I’m getting ‘Access denied for user … Using password:YES …
Mysql::Error’ message. The OS is Solaris 5.9, Ruby is 1.8.6 and Rails
is 1.2.3. AFAIK these are all fairly new adn shouldn’t suffer from the
‘old password’ effect - even so , I have forced the password to be ‘old
style’ to be on the safe side. The database.yml looks OK to me
Sorry, I should have made that clearer - there are two instances of
mysql running and the one I want is on 3406. In fact, is there any
possibility this line is being ignored and port 3306 is being used,
because if I change ‘port’ to some random number (1234) I get the same
error message (‘Access denied’)? I’m confident I’m editing the right
section of datanbase.yml because if I change, say, the username then I
see the new username reflected in the error message I get.
William P. wrote:
The standard mysql port is 3306, not 3406. Do you have mysql running on
a different port? If not, change database.yml to
development:
adapter: mysql
database: mydatabase1_development
username: tobyr
password: mypassword #socket: /tmp/mysql.sock
host: localhost
port: 3306 # <- port 3306
Fixed it! The problem was related to the two instances of Mysql. I
wanted to connect to the instance on the non-standard port (3406). I
correctly added the ‘port: 3406’ line to database.yml, but I left ‘host:
localhost’. However, as implied at http://www.kitebird.com/articles/ruby-mysql.html#TOC_12 ‘localhost’ is
relevant to the Unix socket, not a TCP/IP connection. So, strange as it
may seem, replacing ‘localhost’ with the Fully Qualified Domain Name
fixed the problem.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.