Cygwin Cannot Connect To Mysql

Last modified: 
Sunday, March 29th, 2015
Topics: 
CygwinMySQL

Problem

Running mysql on Cygwin returns the following error:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql.sock' (2)

Solution

Declare the host as 127.0.0.1 using the -h flag.

mysql -u root -h -p 127.0.01


The operator of this site makes no claims, promises, or guarantees of the accuracy, completeness, originality, uniqueness, or even general adequacy of the contents herein and expressly disclaims liability for errors and omissions in the contents of this website.