dbcli / mycli

A Terminal Client for MySQL with AutoCompletion and Syntax Highlighting.
http://mycli.net
Other
11.39k stars 657 forks source link

MyCLI with Git Bash does not work - Win10 #560

Open aeimer opened 6 years ago

aeimer commented 6 years ago

Hi there,

I have python3 installed on my Windows10 computer, furthermore I have installed the current Git (Bash) Version.

I have installed mycli with pip3.exe install mycli on gitbash.

I can call mycli:

$ mycli
(2003, "Can't connect to MySQL server on 'localhost' ([WinError 10061] Es konnte keine Verbindung hergestellt werden, da der Zielcomputer die Verbindung verweigerte)")

Ok great, works. I have no mysql running locally.

I can call mycli --help:

$ mycli --help
Usage: mycli [OPTIONS] [DATABASE]

  A MySQL terminal client with auto-completion and syntax highlighting.

  Examples:
    - mycli my_database
    - mycli -u my_user -h my_host.com my_database
    - mycli mysql://my_user@my_host.com:3306/my_database

Options:
  -h, --host TEXT               Host address of the database.
  -P, --port INTEGER            Port number to use for connection. Honors
                                $MYSQL_TCP_PORT.
  -u, --user TEXT               User name to connect to the database.
  -S, --socket TEXT             The socket file to use for connection.
  -p, --password TEXT           Password to connect to the database.
  --pass TEXT                   Password to connect to the database.
  --ssl-ca PATH                 CA file in PEM format.
  --ssl-capath TEXT             CA directory.
  --ssl-cert PATH               X509 cert in PEM format.
  --ssl-key PATH                X509 key in PEM format.
  --ssl-cipher TEXT             SSL cipher to use.
  --ssl-verify-server-cert      Verify server's "Common Name" in its cert
                                against hostname used when connecting. This
                                option is disabled by default.
  -v, --version                 Output mycli's version.
  -D, --database TEXT           Database to use.
  -d, --dsn TEXT                Use DSN configured into the [alias_dsn]
                                section of myclirc file.
  -R, --prompt TEXT             Prompt format (Default: "\t \u@\h:\d> ").
  -l, --logfile FILENAME        Log every query and its results to a file.
  --defaults-group-suffix TEXT  Read MySQL config groups with the specified
                                suffix.
  --defaults-file PATH          Only read MySQL options from the given file.
  --myclirc PATH                Location of myclirc file.
  --auto-vertical-output        Automatically switch to vertical output mode
                                if the result is wider than the terminal
                                width.
  -t, --table                   Display batch output in table format.
  --csv                         Display batch output in CSV format.
  --warn / --no-warn            Warn before running a destructive query.
  --local-infile BOOLEAN        Enable/disable LOAD DATA LOCAL INFILE.
  --login-path TEXT             Read this path from the login file.
  -e, --execute TEXT            Execute command and quit.
  --help                        Show this message and exit.

Works too.

But now I tried to connect to an public mysql, which just lets me wait (for ever?):

$ mycli mysql://anonymous@ensembldb.ensembl.org:3306

The same command worked on PowerShell:

S C:\Users\Alexander Eimer> mycli mysql://anonymous@ensembldb.ensembl.org:3306
Version: 1.16.0
Chat: https://gitter.im/dbcli/mycli
Mail: https://groups.google.com/forum/#!forum/mycli-users
Home: http://mycli.net
Thanks to the contributor - Whitane Tech
(none)>

So I think there is assume there is a problem with the GitBash?!

j-bennet commented 6 years ago

We used to have display problems with git bash, but not connection problems. Are you able to connect with the official mysql client?

aeimer commented 6 years ago

As I wrote, on PowerShell it does work. Not very pretty (there are some display problem too), but it connected.

Here you can see the DB on HeidiSQL (copied the values from this issue): grafik

j-bennet commented 6 years ago

But what about connecting with mysql under git bash?

aeimer commented 6 years ago

I don't have mysql installed on my local pc

j-bennet commented 6 years ago

Then how about telnet ensembldb.ensembl.org 3306 under git bash? You should see something like this if it connects:

Connected to ensembldb.ebi.ac.uk.
Escape character is '^]'.
aeimer commented 6 years ago

I first have activated telnet on my system. Then in my gitbash I get this:

$ /c/Windows/System32/telnet.exe ensembldb.ensembl.org 3306

$ /c/Windows/System32/telnet.exe ensembldb.ensembl.org 3306 ; echo $?
127

$ curl ensembldb.ensembl.org:3306 -s
O?0qjABh▒▒eB["5%Xl6e}dmysql_native_password!▒▒#08S01Got packets out of order

On Powershell telnet works:

PS C:\Users\Alexander Eimer> telnet ensembldb.ensembl.org 3306
J
nQ*zLKqÇ+fAS[Qe(6vrZmysql_native_password!#08S01Got packets out of order

Verbindung zu Host verloren.
PS C:\Users\Alexander Eimer>