Git Bash 2.5 cannot connect to mysql

I’m having a really annoying problem to connect to MySQL by Git Bash 2.5 (via Windows on localhost).
Everything works fine trough CMD and Mysysgit.

$ mysql -u root -proot
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 5.6.26-log MySQL Community Server (GPL)
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>

  • Handling changes to files with --skip-worktree from another branch
  • git clone: RPC failed; result=22; HTTP code = 408
  • Git objects SHA-1 are file contents or file names?
  • Is there an internal alternative to gist.github.com to run behind a firewall?
  • how to up my project files to my git hub using phpfog
  • Getting merged code “right” with Git
  • But, look at this. Git SCM for windows still stuck, blinking the cursor for ever and ever. Have you guys seen this? Anyone can help me?

    $ mysql -u root -proot
    Warning: Using a password on the command line interface can be insecure.

    Thanks in advance.

  • Resume chained commands after resolved merge conflict
  • Git Diff and Meld on Windows
  • Unable to Clone Gerrit Repository
  • accidentally committed in git
  • How do I compile Android 4.4.2 for Qualcomm MSM systems?
  • Cannot fetch from git in Team City 8.1.2
  • 2 Solutions collect form web for “Git Bash 2.5 cannot connect to mysql”

    the solution is provided here:
    Git Bash mysql blank

    use this winpty before any window command and it works.

    winpty mysql -u root -proot
    

    The issue 242 point out:

    this is a known problem (see git-for-windows/build-extra/installer):

    Some console programs interact correctly with MinTTY only when called through winpty (e.g. the Python console needs to be started as winpty python instead of just python).

    If you do not like that, feel free to choose the installer option not to use MinTTY.

    Please note also that Git for Windows is not your “Linux on Windows”. It really is supporting Git on Windows and not necessarily mysql.

    Using mysql in a docker container (like nkratzke/EasyMySQL) would be easier and provide a more manageable Linux environment.

    Git Baby is a git and github fan, let's start git clone.