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
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

  • Git Submodules: It is possible to provide both https and ssh access to submodules?
  • git p4 submit fails
  • How to develop PHP packages in a team using composer?
  • Last 7 Git commit disappeared and head moved back
  • Version Control with Bitbucket (Git) throws error “no current branch”
  • Is it better to use git branch -f or git update-ref to fast-forware existing branch?
  • 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.

  • Can't add a file separated with space to git
  • Using git with multiple branches at once
  • Is a private repository on github or bitbucket safe for storage of passwords?
  • Remove a file from Git in Visual Studio
  • How to track two version of a project in one GIT repository?
  • Can I use my ssh keypair from a different machine
  • 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.