Can't run MySQL under Cygwin : connect to server at 'localhost' failed (only when using password)

2011-11-18 Thread Franck Houssen

Hello mysql-list, 

I try to install MySQL under Cygwin : I can build (mysql-5.5.17 on windows 7 
using Cygwin), I can start and stop the server (only using mysqld.server - 
mysqladmin fails to connect).
I can not connect to the server when I want to use a password (if I don't use 
any password the connection to the server succeeds).
 
I need client AND server. I followed the on line mysql doc. Some comments about 
the installation / running process that I would underline :I do NOT use 
--without-server option in configure (I need the server)I use readline (ccmake 
configuration) and not libedit : could this be a problem ?I used  
mysql_install_db with --basedir, --datadir and --skip-name-resolve optionsI use 
a user dummy (that belongs to the mysql group) : I can not create the mysql 
user (Windows prevent me from creating a mysql user for a reason I can't figure 
out : I stopped fighting with Windows. As mentionned in the on-line doc, MySQL 
should work with any user : dummy is my user - dummy belongs to the group 
mysql - and the password is dummy)the root user doesn't exist in Cygwin (as 
far as I understand) : I can't use any mysqlamdin -u root ... as described in 
the on-line mysql doc 
When I use mysql or mysqladmin triggering a connection using a password, 
the connection fails (but succeeds if no password is used). May be someone 
could find a clue to solve this problem !... Could someone help me ?
 
Thanks
 
Franck
 
Here after is a detailed description of the problem :  $ mkgroup -l  
/etc/group (update groups Windows - Cygwin)

 

$ mkpasswd -l  /etc/passwd (update passwords Windows - Cygwin) $ more 
etc/group | grep mysql (check OK)
mysql:S-1-5-21-4028741454-3406211479-1246761672-1004:1004:

$ more passwd | grep dummy (check OK)
dummy:unused:1000:513:dummy,U-dummy-PC\dummy,S-1-5-21-4028741454-3406211479-1246761672-1000:/home/dummy:/bin/bash

$ chgrp -R None /tmp (give read / write access to all users)

 

$ chgrp -R None /var (give read / write access to all users)

  

$ ll (check OK)

total 229

drwxrwxrwt+ 1 dummy None   0 Nov 14 11:57 tmp

drwxr-xr-x+ 1 dummy None   0 Aug 17 20:58 var

 

$ chgrp -R mysql /usr/local/mysql (give read / write access to users of mysql 
group)

 

$ chown -R dummy /usr/local/mysql (give read / write access to users of mysql 
group)

  

$ ps (check : no server)

  PIDPPIDPGID WINPID  TTY  UIDSTIME COMMAND

 3400   13400   3400  con 1000 11:10:39 /usr/bin/bash

 675634006756   5400  con 1000 12:14:46 /usr/bin/ps

 

$ ll /tmp (check : no mysql.sock)

total 12

drwxrwxrwt+ 1 dummy None  0 Nov 14 11:57 .

drwxr-xr-x+ 1 dummy Administrateurs   0 Nov  5 00:37 ..

drwxrwxrwt+ 1 dummy None  0 Nov  9 18:40 .X11-unix

drwxr-xr-x+ 1 dummy None  0 Aug 18 00:00 hsperfdata_dummy

-rw-r--r--  1 dummy None316 Oct 26 09:13 xkb_4Di75h

-rw-r--r--  1 dummy None316 Oct 27 00:08 xkb_4NrKCL

-rw-r--r--  1 dummy None316 Oct 27 00:09 xkb_ThcsMy

-rw-r--r--  1 dummy None316 Oct 27 00:10 xkb_shbOiY

 

$ mysqld --user=dummy  (launch server : OK)

14 12:15:54 InnoDB: The InnoDB memory heap is disabled

14 12:15:54 InnoDB: Mutexes and rw_locks use GCC atomic builtins

14 12:15:54 InnoDB: Compressed tables use zlib 1.2.5

14 12:15:54 InnoDB: Initializing buffer pool, size = 128.0M

14 12:15:54 InnoDB: Completed initialization of buffer pool

14 12:15:54 InnoDB: highest supported file format is Barracuda.

14 12:15:54  InnoDB: Waiting for the background threads to start

14 12:15:55 InnoDB: 1.1.8 started; log sequence number 1595675

14 12:15:55 [Note] Event Scheduler: Loaded 0 events

14 12:15:55 [Note] mysqld: ready for connections.

Version: '5.5.17'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution



$ ll /tmp (check: mysql.sock is created and can be accessed - read / write 
permissions)

total 13

drwxrwxrwt+ 1 dummy None  0 Nov 14 12:15 .

drwxr-xr-x+ 1 dummy Administrateurs   0 Nov  5 00:37 ..

srwxrwxrwx  1 dummy None  0 Nov 14 12:15 mysql.sock

 

$ ps (check: server launched OK) 

  PIDPPIDPGID WINPID  TTY  UIDSTIME COMMAND

 472034004720   6576  con 1000 12:15:53 
/usr/local/mysql/bin/mysqld

 $ mysql -u dummy -p (when I hit return as a password = connection OK)
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
mysql show tables;
ERROR 1046 (3D000): No database selected
mysql quit
Bye
 
$ mysql -u dummy -p (when I type a real password : dummy, YES... or anything 
else)
ERROR 1045 (28000): Access denied for user 'dummy'@'localhost' (using password: 
YES) $ mysqladmin -u dummy version (try without password = KO)

mysqladmin: connect to server at 'localhost' failed

error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' 
(4)'

Check that mysqld is running and that the 

Can't run MySQL under Cygwin : connect to server at 'localhost' failed (only when using password)

2011-11-17 Thread Franck Houssen





Hello mysql-list, 
I try to install MySQL under Cygwin : I can build (mysql-5.5.17 on windows 7 
using Cygwin), I can start and stop the server (only using mysqld.server - 
mysqladmin fails to connect).
I can not connect to the server when I want to use a password (if I don't use 
any password the connection to the server succeeds).
 
I need client AND server. I followed the on line mysql doc. Some comments about 
the installation / running process that I would underline :I do NOT use 
--without-server option in configure (I need the server)I use readline (ccmake 
configuration) and not libedit : could this be a problem ?I used  
mysql_install_db with --basedir, --datadir and --skip-name-resolve optionsI use 
a user dummy (that belongs to the mysql group) : I can not create the mysql 
user (Windows prevent me from creating a mysql user for a reason I can't figure 
out : I stopped fighting with Windows. As mentionned in the on line doc, MySQL 
should work with any user : dummy is my user and the password is dummy)the 
root user doesn't exist in Cygwin (as far as Iunderstand) : I can't use any 
mysqlamdin -u root ...  
When I use mysql or mysqladmin triggering a connection using a password, 
the connection fails (but succeeds if no password is used). May be someone 
could find a clue to solve this problem !... Could someone help me ?
 
Thanks
 
F.
 
Here after is a detailed description of the problem :  My configuration file 
my.cnf is (I tried to put the minimum things to make it work) : [client]
password = dummyport  = 3306
socket  = /tmp/mysql.sock
[mysqld]
port  = 3306
socket  =  /tmp/mysql.sock
datadir  =  /usr/local/mysql/datatmpdir = /tmp/
Here is a command line description of the problem : $ mkgroup -l  /etc/group 
(update groups Windows - Cygwin)

 

$ mkpasswd -l  /etc/passwd (update passwords Windows - Cygwin) $ more 
etc/group | grep mysql (check OK)
mysql:S-1-5-21-4028741454-3406211479-1246761672-1004:1004:

$ more passwd | grep dummy (check OK)
dummy:unused:1000:513:dummy,U-dummy-PC\dummy,S-1-5-21-4028741454-3406211479-1246761672-1000:/home/dummy:/bin/bash

$ chgrp -R None /tmp (give read / write access to all users)

 

$ chgrp -R None /var (give read / write access to all users)

  

$ ll (check OK)

total 229

drwxrwxrwt+ 1 dummy None   0 Nov 14 11:57 tmp

drwxr-xr-x+ 1 dummy None   0 Aug 17 20:58 var

 

$ chgrp -R mysql /usr/local/mysql (give read / write access to users of mysql 
group)

 

$ chown -R dummy /usr/local/mysql (give read / write access to users of mysql 
group)

  

$ ps (check : no server)

  PIDPPIDPGID WINPID  TTY  UIDSTIME COMMAND

 3400   13400   3400  con 1000 11:10:39 /usr/bin/bash

 675634006756   5400  con 1000 12:14:46 /usr/bin/ps

 

$ ll /tmp (check : no mysql.sock)

total 12

drwxrwxrwt+ 1 dummy None  0 Nov 14 11:57 .

drwxr-xr-x+ 1 dummy Administrateurs   0 Nov  5 00:37 ..

drwxrwxrwt+ 1 dummy None  0 Nov  9 18:40 .X11-unix

drwxr-xr-x+ 1 dummy None  0 Aug 18 00:00 hsperfdata_dummy

-rw-r--r--  1 dummy None316 Oct 26 09:13 xkb_4Di75h

-rw-r--r--  1 dummy None316 Oct 27 00:08 xkb_4NrKCL

-rw-r--r--  1 dummy None316 Oct 27 00:09 xkb_ThcsMy

-rw-r--r--  1 dummy None316 Oct 27 00:10 xkb_shbOiY

 

$ mysqld --user=dummy  (launch server : OK)

14 12:15:54 InnoDB: The InnoDB memory heap is disabled

14 12:15:54 InnoDB: Mutexes and rw_locks use GCC atomic builtins

14 12:15:54 InnoDB: Compressed tables use zlib 1.2.5

14 12:15:54 InnoDB: Initializing buffer pool, size = 128.0M

14 12:15:54 InnoDB: Completed initialization of buffer pool

14 12:15:54 InnoDB: highest supported file format is Barracuda.

14 12:15:54  InnoDB: Waiting for the background threads to start

14 12:15:55 InnoDB: 1.1.8 started; log sequence number 1595675

14 12:15:55 [Note] Event Scheduler: Loaded 0 events

14 12:15:55 [Note] mysqld: ready for connections.

Version: '5.5.17'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution



$ ll /tmp (check: mysql.sock is created and can be accessed - read / write 
permissions)

total 13

drwxrwxrwt+ 1 dummy None  0 Nov 14 12:15 .

drwxr-xr-x+ 1 dummy Administrateurs   0 Nov  5 00:37 ..

srwxrwxrwx  1 dummy None  0 Nov 14 12:15 mysql.sock

 

$ ps (check: server launched OK) 

  PIDPPIDPGID WINPID  TTY  UIDSTIME COMMAND

 472034004720   6576  con 1000 12:15:53 
/usr/local/mysql/bin/mysqld

 $ mysql -u dummy -p (when I hit return as a password = connection OK)
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
mysql show tables;
ERROR 1046 (3D000): No database selected
mysql quit
Bye
 
$ mysql -u dummy -p (when I type a real password : dummy, YES... or anything 
else)
ERROR 1045 (28000): Access denied for user 'dummy'@'localhost' (using password: 
YES) $ mysqladmin