It doesn't work on Ubuntu on windows10.
I tried all methods in #456, but it doesn't work.
System:
Ubuntu 18.04 bionic [Ubuntu on Windows 10]
I try mycli -S /var/run/mysqld/mysqld.sock -u root, but it responsed the msessage: (2003, "Can't connect to MySQL server on 'localhost' ([Errno 2] Invalid argument)").
This is the ouput from the \s command.
mysql Ver 14.14 Distrib 5.7.23, for Linux (x86_64) using EditLine wrapper
Connection id: 15
Current database:
Current user: root@localhost
SSL: Not in use
Current pager: less
Using outfile: ''
Using delimiter: ;
Server version: 5.7.23-0ubuntu0.18.04.1 (Ubuntu)
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: latin1
Db characterset: latin1
Client characterset: utf8
Conn. characterset: utf8
UNIX socket: /var/run/mysqld/mysqld.sock
Uptime: 23 min 59 sec
Threads: 1 Questions: 29 Slow queries: 0 Opens: 107 Flush tables: 1 Open tables: 26 Queries per
Hmm maybe because sockets are disabled for Windows: https://github.com/dbcli/mycli/blob/master/mycli/main.py#L405
Hmm maybe because sockets are disabled for Windows: https://github.com/dbcli/mycli/blob/master/mycli/main.py#L405
Is that mean mycli will not work on WSL?
I was wrong; sys.platform returns on WSL linux. So sockets should work.
Could you please tell me how you've installed mysql-server on WSL? I've installed mysql using apt-get install mysql-server and started mysqld / mysqld_safe but it seems to stop after a few seconds.
I was wrong;
sys.platformreturns on WSLlinux. So sockets should work. Could you please tell me how you've installed mysql-server on WSL? I've installed mysql using apt-get install mysql-server and started mysqld / mysqld_safe but it seems to stop after a few seconds.
I use apt-get install mysql-server, and start service by service mysql start
@GEeKkk I just reproduced this on WSL and was able to connect with:
$ mycli -u root -h 127.0.0.1
Can you see if that works for you?
I was able to trace this error to the original exception:
~ $ mycli -S /var/run/mysqld/mysqld.sock -u root
Traceback (most recent call last):
File "/home/tsr/.local/bin/mycli", line 11, in <module>
sys.exit(cli())
File "/home/tsr/.local/lib/python2.7/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/home/tsr/.local/lib/python2.7/site-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/home/tsr/.local/lib/python2.7/site-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/tsr/.local/lib/python2.7/site-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/home/tsr/.local/lib/python2.7/site-packages/mycli/main.py", line 1114, in cli
ssh_key_filename=ssh_key_filename
File "/home/tsr/.local/lib/python2.7/site-packages/mycli/main.py", line 443, in connect
_connect()
File "/home/tsr/.local/lib/python2.7/site-packages/mycli/main.py", line 404, in _connect
ssh_password, ssh_key_filename
File "/home/tsr/.local/lib/python2.7/site-packages/mycli/sqlexecute.py", line 62, in __init__
self.connect()
File "/home/tsr/.local/lib/python2.7/site-packages/mycli/sqlexecute.py", line 118, in connect
defer_connect=defer_connect
File "/home/tsr/.local/lib/python2.7/site-packages/pymysql/__init__.py", line 94, in Connect
return Connection(*args, **kwargs)
File "/home/tsr/.local/lib/python2.7/site-packages/pymysql/connections.py", line 327, in __init__
self.connect()
File "/home/tsr/.local/lib/python2.7/site-packages/pymysql/connections.py", line 591, in connect
sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
File "/usr/lib/python2.7/socket.py", line 228, in meth
return getattr(self._sock,name)(*args)
socket.error: [Errno 22] Invalid argument
I haven't had time to dig into the error though. Here are the connection details for reference:
mycli.sqlexecute DEBUG - Connection DB Params:
database: None
user: u'root'
host: u'localhost'
port: 3306
socket: u'/var/run/mysqld/mysqld.sock'
charset: u'utf8'
local_infile: False
ssl: None
ssh_user: None
ssh_host: None
ssh_port: 22
ssh_password: None
ssh_key_filename: None
It appears to happen on both Python 2 and 3.
@GEeKkk I just reproduced this on WSL and was able to connect with:
$ mycli -u root -h 127.0.0.1Can you see if that works for you? No, it doesn't work : (
I tried connecting with:
$ mycli -S /var/run/mysqld/mysqld.sock -u root -h 127.0.0.1
It returns the following:
(1698, "Access denied for user 'root'@'localhost'")
Same Problem with me 😥😥😥
mycli doesn't work from wsl linux (ubuntu 18.04). i try to connect to my external mysql service but obtain : (9999, 'An internal error has occurred. Please retry or report your issues.\x00')
last wsl (Ubuntu) update : it works now
