Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't connect, socket option seems ignored #887

Open
xeron opened this issue Jul 26, 2020 · 1 comment
Open

Can't connect, socket option seems ignored #887

xeron opened this issue Jul 26, 2020 · 1 comment
Assignees

Comments

@xeron
Copy link

@xeron xeron commented Jul 26, 2020

mycli 1.22.1
macOS 10.15.6
python 3.8.5

$ cat ~/.my.cnf
[client]
port    = 3306
socket  = /opt/local/var/run/mysql8/mysqld.sock
$ mycli -uroot --socket=/opt/local/var/run/mysql8/mysqld.sock
(2003, "Can't connect to MySQL server on 'localhost' ([Errno 61] Connection refused)")
$ mysql -uroot
…
mysql>

According to tcpdump it still tries TCP connection to 3306.

1.20.1 works just fine even without --socket:

$ mycli -uroot
mysql 8.0.21
mycli 1.20.1
@pasenor pasenor self-assigned this Jul 27, 2020
@terjeros
Copy link

@terjeros terjeros commented Jul 27, 2020

Reason seems to be that ssh_port has default value of 22 and this condition is always true:

if port or host or ssh_host or ssh_port:
        socket = ''
else:

https://github.com/dbcli/mycli/blob/master/mycli/main.py#L387

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.