Problem with rails environment with cygwin...mysql doesn't

I have rails 1.2.2, ruby 1.8, mysql 5 and Rad Rails in my win XP and
this
stack works fine.

But I’m trying to use rails 2.1, mongrel, capistrano, git, mysql all in
cygwin and e Text Editor.The only think that doesn’t work is mysql.I
installed this app from the source(in version 5.0.45, ./configure then
make install).All
right, but when I try to launch this error occurs:

“can’t connect to local Mysql Server through socket ‘/tmp/mysql.sock’”

Bellow, my mysql options in my.cnt

[client]
port = 3306
socket = /var/tmp/mysql.sock

[mysqld]
port = 3306
socket = /var/tmp/mysql.sock
datadir = /usr/local/mysql/data

Why this kind of problem happen? Many post in others forum about this
problem don’t help me

Rest only this detail for I’ll use rails 2.1

Thank’s for help me

I’m not a CygWin expert, but I would expect that since your error
message is saying that “’/tmp/mysql.sock’” can’t be found, but both your
config files point to “’/var/tmp/mysql.sock’”, the mysql command you are
running is using some different config file. You need to search and find
another config file for MySQL and see if it is pointing to the first
version - if so, then that’s the config file that you need to update to
point to the second version.

You know that you can run all these things on XP without CygWin, right?

c.

Bruno M. wrote:

I have rails 1.2.2, ruby 1.8, mysql 5 and Rad Rails in my win XP and
this
stack works fine.

But I’m trying to use rails 2.1, mongrel, capistrano, git, mysql all in
cygwin and e Text Editor.The only think that doesn’t work is mysql.I
installed this app from the source(in version 5.0.45, ./configure then
make install).All
right, but when I try to launch this error occurs:

“can’t connect to local Mysql Server through socket ‘/tmp/mysql.sock’”

Bellow, my mysql options in my.cnt

[client]
port = 3306
socket = /var/tmp/mysql.sock

[mysqld]
port = 3306
socket = /var/tmp/mysql.sock
datadir = /usr/local/mysql/data

Why this kind of problem happen? Many post in others forum about this
problem don’t help me

Rest only this detail for I’ll use rails 2.1

Thank’s for help me

On Wed, 2008-06-04 at 03:04 +0200, Cayce B. wrote:

I’m not a CygWin expert, but I would expect that since your error
message is saying that “’/tmp/mysql.sock’” can’t be found, but both your
config files point to “’/var/tmp/mysql.sock’”, the mysql command you are
running is using some different config file. You need to search and find
another config file for MySQL and see if it is pointing to the first
version - if so, then that’s the config file that you need to update to
point to the second version.

You know that you can run all these things on XP without CygWin, right?


I didn’t think that you could use sockets on windows but rather had to
use port 3306 for mysql

Craig

On Wed, 2008-06-04 at 03:44 +0200, Cayce B. wrote:

You know that you can run all these things on XP without CygWin, right?


I didn’t think that you could use sockets on windows but rather had to
use port 3306 for mysql

Craig

He installed mySQL within Cygwin (posix) from source, so if he’s running
under Cygwin he’d be using sockets just like on any other *nix.

I think. :wink:


That may be possible but even so…it would have to be mysql on Windows
that created the socket which I don’t think it would do out of the box
and I wouldn’t have the first idea on how to get MySQL on Windows to do
that.

I think that on Windows, you’re better off just using the port and
commenting out all socket references.

Craig

Craig W. wrote:

On Wed, 2008-06-04 at 03:04 +0200, Cayce B. wrote:

I’m not a CygWin expert, but I would expect that since your error
message is saying that “’/tmp/mysql.sock’” can’t be found, but both your
config files point to “’/var/tmp/mysql.sock’”, the mysql command you are
running is using some different config file. You need to search and find
another config file for MySQL and see if it is pointing to the first
version - if so, then that’s the config file that you need to update to
point to the second version.

You know that you can run all these things on XP without CygWin, right?


I didn’t think that you could use sockets on windows but rather had to
use port 3306 for mysql

Craig

He installed mySQL within Cygwin (posix) from source, so if he’s running
under Cygwin he’d be using sockets just like on any other *nix.

I think. :wink:

Frederick C. wrote:

On 4 Jun 2008, at 02:04, Cayce B. wrote:

to
point to the second version.

Rails’s database.yml ? I believe the default docket is /tmp/mysql.sock

Fred

That’s a good point - I assumed by “launch” he meant just connecting to
the database, not the Rails app.

Bruno - can you connect to the db through the command line in CygWin? If
so, then as Fred notes above you need to add this line to your
database.yml file for each environment:

socket: /var/tmp/mysql.sock

On 4 Jun 2008, at 02:04, Cayce B. wrote:

to
point to the second version.

Rails’s database.yml ? I believe the default docket is /tmp/mysql.sock

Fred

Cayce B. wrote:

Frederick C. wrote:

On 4 Jun 2008, at 02:04, Cayce B. wrote:

to
point to the second version.

Rails’s database.yml ? I believe the default docket is /tmp/mysql.sock

Fred

That’s a good point - I assumed by “launch” he meant just connecting to
the database, not the Rails app.

Bruno - can you connect to the db through the command line in CygWin? If
so, then as Fred notes above you need to add this line to your
database.yml file for each environment:

socket: /var/tmp/mysql.sock

I’m my file my.cnt I put this:

The following options will be passed to all MySQL clients

[client]
password = admin
port = 3306

The MySQL server

[mysqld]
port = 3306

and I try to connect with db:

mysql -h 127.0.0.1 -u root -p

So, after the password, this error happen:

Error 2003 (HY000):Can’t connect to MySQL server on ‘127.0.0.1’ (111)

the same occurs if I put host = 127.0.0.1. in the my.cnt and
execute mysql -u root -p

Thank’s guys for your help until here.

Bruno -

Based on Fred’s earlier note, I would go back to your original my.cnt
file (as shown in OP) and then just add this line in your application’s
database.yml file for each environment:

socket: /var/tmp/mysql.sock

Fred pointed out that it looked as if your error was related to Rails
app looking in the wrong place for the socket, so adding that line above
will match up the Rails app with what your original my.cnt was showing
and hopefully all will be well.

But i’m trying to connect to mysql without rails first, i want just use
mysql
command line in the same way than I use in windows.I beliave that when
mysql
works fine in cygwin, rails applications will be work fine too.

Thanks for one more time, but the problem still alive…rsssss

Punt CygWin.

http://dev.mysql.com/downloads/mysql/5.0.html#win32

Windows Essentials - one-click installer, easy configuration after
install and boom you’re up and running.

Cayce B. wrote:

Bruno -

Based on Fred’s earlier note, I would go back to your original my.cnt
file (as shown in OP) and then just add this line in your application’s
database.yml file for each environment:

socket: /var/tmp/mysql.sock

Fred pointed out that it looked as if your error was related to Rails
app looking in the wrong place for the socket, so adding that line above
will match up the Rails app with what your original my.cnt was showing
and hopefully all will be well.

But i’m trying to connect to mysql without rails first, i want just use
mysql
command line in the same way than I use in windows.I beliave that when
mysql
works fine in cygwin, rails applications will be work fine too.

Thanks for one more time, but the problem still alive…rsssss


Thank’s so much Peter!

But I have now this error

ERROR 2005 (HY000): Unknown MySQL server host ‘local’ (1)

So , when I try start the server another drug :

PC@BERAS:mysql$ ./mysql.server start
Starting MySQL…/mysql.server: line 159: kill: (3208) - No such
process
ERROR!

I’ll forgive use cygwin for Rails development,

In the end of tunnel Ubuntu stay waiting…rssssss

I’ll use instant rails and mysql on windows

On Thu, Jun 5, 2008 at 1:57 PM, Cayce B. <
[email protected]> wrote:

Punt CygWin.

HI Bruno,

In my experience, even though Cygwin is “supposed” to have sockets, it’s
still running on top of Win32, and mysql is one instance where the
sockets
are difficult to configure.

Even after you install Mysql-Windows.msi (which I strongly recommend you
take this route), then you have two connection choices:

  1. mysql -h 127.0.0.1

  2. add ‘local’ to /etc/hosts like this :
    127.0.0.1 localhost local
    Then this works
    $ mysql -h local

Then your database.yml will have

login: &login
adapter: mysql
username: username
password: password
host: local

development:
<<: *login
database: app_dev

On the other hand, VMWare Server (free) and Ubuntu (free) are wonderful
alternatives :slight_smile:


Peter F.

iPhone – “IT”-ness.
href=
Apple’s iPhone could become iconic ‘It Object’ - MacDailyNews

For cygwin you forgot to add ‘local’ to /etc/hosts
$ vi /etc/hosts ==> append ‘local’ to the 127.0.0.1 line
$ cat /etc/hosts
127.0.0.1 localhost local
IPV6 …

On Thu, Jun 5, 2008 at 11:12 PM, Bruno M. <
[email protected]> wrote:

I’ll use instant rails and mysql on windows

Posted via http://www.ruby-forum.com/.


Peter F.

iPhone – “IT”-ness.
href=
Apple’s iPhone could become iconic ‘It Object’ - MacDailyNews

I attempted to set this up at work for a developer environment , I
noticed some funky things. Like cygwin would use the mysql libs but it
would actually connect to the mysql windows install. I could not get
it to work unless i installed mysql for windows, and even then it had
to be running in the background. I never really figured out the reason
for this but i couldn’t really spend the ammount of time on it that i
needed to to figure it out. If you are attempting to run a Linux like
dev environment in windows i’d go with VM ware or some sort of VM
solution.
Even then i just went with putty/ssh + vim on a real linux box.

On Jun 6, 10:47 am, Bruno M. [email protected]

THANK YOU THANK YOU THANK YOU!

Peter F. wrote:

Then your database.yml will have

login: &login
adapter: mysql
username: username
password: password
host: local

No, I do this

It’s possible to rails rails installed over cywin access mysql under
windows?

Peter F. wrote:

For cygwin you forgot to add ‘local’ to /etc/hosts
$ vi /etc/hosts ==> append ‘local’ to the 127.0.0.1 line
$ cat /etc/hosts
127.0.0.1 localhost local
IPV6 …

On Thu, Jun 5, 2008 at 11:12 PM, Bruno M. <
[email protected]> wrote:

I’ll use instant rails and mysql on windows

Posted via http://www.ruby-forum.com/.


Peter F.

iPhone – “IT”-ness.
href=
Apple’s iPhone could become iconic ‘It Object’ - MacDailyNews