connecting to mysql from cygwin

前端 未结 14 1675
时光说笑
时光说笑 2020-12-07 22:08

I can successfully connect to MySQL from a DOS prompt, but when I try to connect from cygwin, it just hangs.

$/cygdrive/c/Program\\ Files/MySQL/MySQL\\ Serve         


        
相关标签:
14条回答
  • Svend Hansen's answer is the right one:

    • Install windows mysql server files (from mysql-5.5.25-win32.msi for example)

    • Install Cygwin mysql client with cygwin installer (setup.exe)

    • Connect to your server in a cygwin window using cygwin client "mysql -u[user] -p[Password] -h[host]", in my case "mysql -uroot -pXXXX -h127.0.0.1"

    I think that when the question was posted, the cygwin setup did not provide mysql components, which is solved now.

    0 讨论(0)
  • 2020-12-07 22:59

    Found this question today 2018-03-18 looking for some answers to

    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql.sock' (2 "No such file or directory")
    

    The file /etc/my.conf references config files in /etc/my.cnf.d I added this to /etc/my.cnf.d/client.cnf:

    [client]
    host=127.0.0.1
    protocol=tcp
    

    After that I was able to access the local windows MySQL instance from a cygwin terminal using mysql -u root -p

    0 讨论(0)
提交回复
热议问题