ERROR 2002 (HY000): Can't connect to local MySQL server through socket... #745

Open
hacdias opened this Issue Aug 3, 2016 · 9 comments

Projects

None yet

8 participants

@hacdias
hacdias commented Aug 3, 2016

Hello!

I'm trying to install MySQL on Bash on Ubuntu on Windows. I'm running bash as admin and run sudo apt-get install mysql-server. In the middle of the installation I can find this:

initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
runlevel:/var/run/utmp: No such file or directory
invoke-rc.d: policy-rc.d denied execution of stop.
initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
runlevel:/var/run/utmp: No such file or directory
invoke-rc.d: policy-rc.d denied execution of start.

And when I start mysql, I get this:

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

Are this sockets not supported yet or am I doing something wrong?
Thanks!

@adeeb1
adeeb1 commented Aug 4, 2016

I had this issue as well. MySQL is installed but could not be run automatically. You can start MySQL with this command:

sudo /etc/init.d/mysql start

@hacdias
hacdias commented Aug 4, 2016

Hey! Thanks for the tip. I'll hear forward to know if this is going to be fixed.

@sunilmut
Member
sunilmut commented Aug 5, 2016

@hacdias - Thanks for reporting this. Is manually starting MySQL using mysql start working for you? Currently, in WSL we do not start the 'upstart' service and so you are seeing the failure. We are looking into supporting some of these services\deamons.

@hacdias
hacdias commented Aug 5, 2016
hacdias@HENRIQUE-PC:/mnt/c/Users/Henrique Dias$ mysql start
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

I don't think so :(

@ATouhou
ATouhou commented Aug 8, 2016

Same thing here
image

@mbeijen
mbeijen commented Oct 12, 2016

I updated to the xenial-based image (ref: https://msdn.microsoft.com/en-us/commandline/wsl/release_notes) and now mysql runs just fine!

@hacdias
hacdias commented Oct 13, 2016

Maybe because of one of the new syscall support. I'll create a virtual machine with the insider preview to test it. Thanks for letting us know that! :)

@jackchammons jackchammons added the mysql label Oct 25, 2016
@aniskhan001

Same for me as well. Happened right after installation while tried to logging in. Build 14959.

@VoLuong
VoLuong commented Feb 19, 2017

Is the xenial based image officially supported yet ? I found some method to do the upgrade on the internet but people say this is neither supported by cannonical or windows

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment