Connect to MySQL via Cygwin

My XAMPP runs on my desktop and can connect to the MySQL server via phpMyAdmin. However, when I try to connect through Cygwin:

Error: cannot connect to local MySQL server through socket '/var/run/mysql.sock' (2)

I tried to connect to MySQL on one computer, my local developer server and the remote server, all failed.

+6
source share
2 answers
mysql -h 127.0.0.1 -P <PORT> -u root -p 

This is what worked for me. Make sure you know the port correctly.

Check mysqld PID with:

 ps -sW | grep mysqld 

And then find PORT with:

 netstat -nao | grep <PID> 

Good luck

+14
source

You can also add your nickname.

 alias mysql = 'mysql -u {user} -p{password} -h 127.0.0.1' 
-3
source

Source: https://habr.com/ru/post/917878/


All Articles