I just came across this, and when I read that someone mentioned that this is the Windows / DOS command that you run in cygwin, I did which mysql and gave me:
$ which mysql /cygdrive/c/Program Files/MySQL/MySQL Server 5.5/bin/mysql
So, I ran cygwin Setup.exe to search for "mysql" and installed the last "mysql client". Now which mysql looks like this:
$ which mysql /usr/bin/mysql
And the MySQL team works in cygwin :)
Although this is an old question, it would be nice to have a real answer here, as people (like me) can still stumble upon it.
If your attempts to start the MySQL client from Cygwin return the following error:
$ mysql -u root -p Enter password: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql.sock' (2)
You can then fix this by adding explicit parameters -h 127.0.0.1 to the command line, for example:
$ mysql -u root -p -h 127.0.0.1
Comments based updates:
To avoid specifying -h 127.0.0.1 on the command line each time you connect, you can add:
[client] host=127.0.0.1
to the file /etc/my.cnf
On some Cygwin installations, specifying a host with -h might not be enough. If so, try also specifying:
--protocol=tcp
or add
protocol=tcp
to the configuration file.
Svend Hansen Apr 03 2018-12-12T00: 00Z
source share