Hi, I am on a OSX and have installed locomotive. I am competant enough
at the momnent to create projects, controllers, models etc through
terminal, however I am finding it hard to connect to a MySQL database.
In the database config file I have set the username and password
correctly but is still giving me an error. The error is somewhere along
the lines of this (I am not 100% sure as I am not at my Mac at the
moment):
Could not connect to mysql database on temp/socket (2)
Now, I think I might know why it isn’t working, but am not sure how to
fix it. I am using MySQL from a MAMP installation, and Ruby with
Locomotive (as previously stated). Ruby is running on port 3000, and
MySQL on 8889 (I think). Do I need to change anything in the database
connection info to allow for this, or should it be done automatically?
Of course, I’m speaking from a Linux perspective. Your milage may vary.
Virgil Tual wrote:
Hi, I am on a OSX and have installed locomotive. I am competant enough
at the momnent to create projects, controllers, models etc through
terminal, however I am finding it hard to connect to a MySQL database.
In the database config file I have set the username and password
correctly but is still giving me an error. The error is somewhere along
the lines of this (I am not 100% sure as I am not at my Mac at the
moment):
Could not connect to mysql database on temp/socket (2)
Now, I think I might know why it isn’t working, but am not sure how to
fix it. I am using MySQL from a MAMP installation, and Ruby with
Locomotive (as previously stated). Ruby is running on port 3000, and
MySQL on 8889 (I think). Do I need to change anything in the database
connection info to allow for this, or should it be done automatically?
The database exists, and MAMP is running with MySQK on port 8888 (I have
tried adding Port: 8888 in the file wih again, no luck). The mysqld
process is also running.
as written in original post he is running MAMP and MAMP will only be in
one location: /Application/MAMP
so the socks file also must be there. in my case it is under
/Applications/MAMP/tmp/mysql. so I added the following line to
database.yml and it woks:
socket: /Applications/MAMP/tmp/mysql/mysql.sock
as written in original post he is running MAMP and MAMP will only be in
one location: /Application/MAMP
so the socks file also must be there. in my case it is under
/Applications/MAMP/tmp/mysql. so I added the following line to
database.yml and it woks:
socket: /Applications/MAMP/tmp/mysql/mysql.sock
hope this helps
Fritzek
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.