【问题标题】:Git Bash 2.5 cannot connect to mysqlGit Bash 2.5 无法连接到 mysql
【发布时间】:2017-05-23 13:26:16
【问题描述】:

我在通过 Git Bash 2.5(通过本地主机上的 Windows)连接到 MySQL 时遇到了一个非常烦人的问题。 通过 CMD 和 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>

但是,看看这个。用于 Windows 的 Git SCM 仍然卡住,一直闪烁光标。你们见过这个吗?谁能帮帮我?

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

提前致谢。

【问题讨论】:

    标签: mysql windows git git-bash


    【解决方案1】:

    这里提供了解决方案: Git Bash mysql blank

    在任何窗口命令之前使用此winpty 即可。

    winpty mysql -u root -proot
    

    【讨论】:

      【解决方案2】:

      issue 242指出:

      这是一个已知问题(请参阅git-for-windows/build-extra/installer):

      一些控制台程序只有在通过 winpty 调用时才能与 MinTTY 正确交互(例如,Python 控制台需要以 winpty python 启动,而不仅仅是 python)。

      如果您不喜欢这样,请随意选择不使用 MinTTY 的安装程序选项。

      另请注意,Windows 版 Git 不是您的“Windows 上的 Linux”。它确实支持 Windows 上的 Git,但不一定支持 mysql。

      在 docker 容器(如 nkratzke/EasyMySQL)中使用 mysql 会更容易,并提供更易于管理的 Linux 环境。

      【讨论】:

        猜你喜欢
        • 2018-06-08
        • 2017-07-01
        • 1970-01-01
        • 2014-04-09
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多