MySQL 命令的自动补全功能

这几天才知道MySQL 命令(command)自动补齐功能 (用了好几年MySQL,现在才知道,真是惭愧呀)但是默认不是开启的。若要开启此功

这几天才知道MySQL 命令(command)自动补齐功能 (用了好几年MySQL,现在才知道,真是惭愧呀)

但是默认不是开启的。若要开启此功能,,可以在Linux中

vi /etc/my.cnf

[mysql]

#no-auto-rehash

auto-rehash         #添加auto-rehash

即将[mysql]中的no-auto-rehash改为auto-rehash

再次登陆MySQL就可以自动补全了。

如果你想尝试在Windows中做同样尝试,会发现不会成功。

原因在下面的英文中有解释:

It ought to work this way:

Or configure your my.cnf:

edit: My apologies. I have found some references that the tab-completion feature in mysql client works only on UNIX/Linux. It does not work on Windows.

update: The reason for this is mentioned briefly in MySQL bug #4731:

[31 Jul 2004 12:47] Sergei Golubchik

I just downloaded 4.0.15 – command completion in mysql.exe is NOT working, as expected. It was never working in mysql.exe because we were not able to make readline to compile with VC++.

mysqlc.exe is a cygwin build, and it is linked with readline.

Explanation: GNU readline is a standard open-source library for handling user input. The MySQL team uses the readline library, but they are not its author. From the above comment, I understand that they were unsuccessful in compiling the readline library on Windows with Microsoft Visual C++, the tool they use to build the MySQL product. Some open-source projects have not been made fully compatible with the Microsoft Windows environment.

At one time in the past, the MySQL product provided an alternative client they called mysqlc.exe, which they compiled with the cygwin toolset on Windows, but they don’t provide this anymore. The cygwin toolset includes the readline library, so it was possible to compile the mysqlc.exe client with support for tab-completion.

So in theory, if you are really intrepid, you could download the cygwin toolset including the readline library, then download the MySQL source code and build it using cygwin. Then you should have a mysql client program that can perform tab-completion. But this sounds like a lot of work even for someone who is familiar with building MySQL from source.

这是MySQL Windows版本的一个Bug :-)

linux

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至253000106@qq.com举报,一经查实,本站将立刻删除。

发布者:PHP中文网,转转请注明出处:https://www.chuangxiangniao.com/p/1953740.html

(0)
上一篇 2025年2月23日 03:12:59
下一篇 2025年2月23日 03:14:28

AD推荐 黄金广告位招租... 更多推荐

相关推荐

  • navicat premium怎么上传数据库

    首先,在Navicat Premium中连接要导出数据库的mysql数据库。 填写好连接数据库的信息后就可以连接到需要导出的数据库了。 打开要导出的数据库。 将数据库的结构和数据导出为SQL文件。 相关推荐:《Navicat for mys…

    2025年2月23日 数据库
    100
  • navicat怎么打开数据库

    1、打开Navicat,点击左上角的‘Conection’按钮。 2、点击后,弹出菜单,我们要选择是哪种类型的数据库,根据你本地部署的数据库类型来选就行了,我这里选择MySql。 3、选择后,弹出窗口,在这个窗口上我们先输入数据库的Host…

    2025年2月23日 数据库
    100
  • navicat怎么清除数据库备份

    第一步,打开Navicat。 第二步,打开mysql数据库连接。 相关推荐:《Navicat for mysql使用图文教程》 第三步,点击备份所在的数据库,并选中备份菜单,此时显示已建的备份。 第四步,右击要删除的备份,在弹出菜单中选择“…

    2025年2月23日 数据库
    100
  • navicat怎么备份数据库

    本篇经验将和大家介绍如何利用Navicat for MySQL进行数据库备份的操作,希望对大家的工作和学习有所帮助! 推荐教程:mysql入门视频教程 1、打开桌面上的或者从开始程序中找到Navicat for MySQL,如下图所示: 2…

    2025年2月23日 数据库
    100
  • navicat新建数据库的步骤

    打开navicat工具,连接上您自己的mysql服务器,然后在如图所示的连接上右击,选择新建数据库。 相关推荐:《Navicat for mysql使用图文教程》 在新建数据库对话框中,需要输入数据库名称,选择字符集和排序规则,名称建议使用…

    2025年2月23日 数据库
    100
  • navicat怎么导入本地数据库

    navicat怎么导入本地数据库,为什么我没有找到该导入的功能呢?请看下面方法。 推荐教程:MySQL入门视频教程 1、首先我们打开软件,并且连接上本地数据库,选中连接,右键打开连接,直接双击也可以的 2、在本地数据库中我们新建一个数据库用…

    2025年2月23日 数据库
    100
  • navicat如何设置高级数据库属性

    Navicat是一套快速、可靠的数据库管理工具,在设置高级连接选项卡中还可以设置高级数据库属性,是否设置高级数据库属性不做强制性要求。如果需要设置高级数据库,前提是勾选“使用高级连接”。详细介绍如下: MySQL、PostgreSQL和Ma…

    2025年2月23日
    100
  • 怎么使用navicat连接数据库

      无论是本机安装的MySQL,还是远程服务器上的MySQL,对其进行管理都特别的麻烦,如何对其进行方便简单的管理呢?Navicat是一款管理MySQL数据库的软件,其简洁明了的界面,使我们能更好的管理数据库,对其进行增删改查的操作。 推荐…

    2025年2月23日 数据库
    100
  • navicat怎么创建数据库

      使用navicat快速创建数据库,我们这以创建Mysql数据库为例,其他数据库在navicat中操作都一样 推荐教程:MySQL数据库入门视频教程 1、打开navicat 2、选中数据库连接“root”右键-》新建数据库 3、填写数据库…

    2025年2月23日 数据库
    100
  • 如何使用navicat为数据库表建立索引?

    下面介绍如何使用Navicat为数据库表建立索引的具体操作方法。 推荐教程:MySQL数据库入门视频教程 1、打开Navicat 2、打开数据表所在的数据库,右击需要新增索引的数据库表,然后点击【设计表】 3、此时进入表设计界面 4、点击【…

    2025年2月23日 数据库
    100

发表回复

登录后才能评论