- 浏览: 246066 次
-
文章分类
最新评论
mysql auto-rehash:读取表信息和列信息,可以在连上终端后开启tab补齐功能。
不启用auto-rehash功能,可以在mysql -h 连接时指定-A选项。
若mysql的默认连接没有设置auto-rehash,也可以在 mysql连接数据库时使用 --auto-rehash来设定使用此选项,开启tab补齐功能。
这几天才知道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:
C:\> mysql --auto-rehash
Or configure your my.cnf:
[mysql]
auto-rehash
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 :-)
不启用auto-rehash功能,可以在mysql -h 连接时指定-A选项。
若mysql的默认连接没有设置auto-rehash,也可以在 mysql连接数据库时使用 --auto-rehash来设定使用此选项,开启tab补齐功能。
这几天才知道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:
C:\> mysql --auto-rehash
Or configure your my.cnf:
[mysql]
auto-rehash
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 :-)
发表评论
-
RAID write back write through
2014-07-09 13:44 960RAID write back指的是raid控制器能够将写 ... -
druid PreparedStatementCache设置
2014-07-08 14:34 3627druid的连接池配置中有PreparedStatement ... -
innodb 插入缓冲
2014-07-01 16:07 708插入缓冲是InnoDB存储引 ... -
Innodb配置,将数据与日志放在不同磁盘可以加快性能
2012-12-06 19:23 753An advanced my.cnf example ... -
character_set_client character_set_connection character_set_results
2012-11-19 20:21 3256之前一直纠结各种编码的却别:character_set_c ... -
amoeba-mysql的安装使用和读写分离(转)
2012-11-16 16:11 1044http://blog.csdn.net/chen861201 ... -
mysqlcheck myisamchk
2012-11-07 17:45 767mysqlcheck的功能类似myisamchk,但其工作不同 ... -
mysqlbinlog乱码
2012-11-06 19:49 5458使用mysqlbinlog查看二进制文件发现 /*!40019 ... -
MySQL主从复制(Master-Slave)与读写分离(MySQL-Proxy)实践
2012-09-19 20:21 781MySQL主从复制(Master-Slave)与读写分离(My ... -
mysql显示见表语句
2012-09-03 19:13 1191show create table mysql.slow_l ... -
mysql主从同步延迟问题
2012-08-30 14:18 865见http://www.ixpub.net/thread-13 ... -
二进制日志文件
2012-08-29 19:33 1162mysqld在每个二进制日志 ... -
备份恢复数据库
2012-08-28 20:18 838全备份 mysqldump -utest -ptest -- ... -
mysql用户修改密码
2012-08-28 19:37 773mysqladmin -utest -ptest passwo ... -
set session sql_log_bin=0
2012-08-21 15:22 4048引自http://blog.sina.com.cn/s/blo ... -
字符串转换成date
2012-08-15 20:00 934SELECT STR_TO_DATE('Tue 05 June ... -
selecting top N records per group
2012-08-15 18:56 925http://code.openark.org/blog/my ... -
MySQL DELAY_KEY_WRITE
2012-08-02 20:03 1145MySQL DELAY_KEY_WRITE 引自http:// ... -
Mysql Merge表的优点
2012-07-09 13:52 965在Mysql数据库中,Mysql Me ... -
MySQL线程共享内存参数
2012-07-03 16:48 898MySQL线程共享内存参数 引用 http://mxohy. ...
相关推荐
laravel-needs-auto-hash ... ...composer require samasend/laravel-needs-auto-rehash 基本用法 就是这样,您只需要安装软件包即可。 :rocket: 这是如何运作的? 这个神奇的程序包侦听的内置Illumi
no-auto-rehash prompt="\u@\h [\d]>" #pager="less -i -n -S" #tee=/opt/mysql/query.log [mysqld] user = mysql basedir = /usr/local/mysql datadir = /data/mysql/mysql3306/data port = 3306 socket = /tmp/...
- **--enable-auto-rehash**:此选项启用自动重哈希功能,允许自动补全数据库、表和列名。虽然默认情况下该功能已启用,但在某些版本中,可以通过特定选项来控制。 **应用场景**:对于提高开发效率,特别是当用户...
- `--auto-rehash`: 启用自动重哈希功能,使用户无需手动使用`rehash`命令即可获得表和字段的自动完成建议,但可能增加启动时间和重新连接时间。 - `--no-auto-rehash` 或 `-A`: 禁用自动重哈希功能,加快启动速度。...
例如,`-A, --no-auto-rehash`选项控制是否开启自动补全功能,这对于快速输入复杂的SQL语句非常有帮助。`-B, --batch`模式则禁用历史记录和交互,适合于自动化脚本执行。 字符集的设置是数据库设计中的关键部分。`-...
- `no-auto-rehash`:禁用自动重新哈希功能,可以减少启动时的内存使用。 3. `[mysqld]`部分: - `user = mysql`:指定了MySQL服务运行的用户。 - `port = 3306`:与客户端配置相同,确保服务端和客户端使用相同...
* no-auto-rehash:禁用自动hash功能 3.[mysqld]部分 * user = mysql:指定MySQL服务器的运行用户 * port = 3306:指定MySQL服务器的监听端口 * socket = /data/3306/mysql.sock:指定MySQL服务器的套接字文件 * ...
no-auto-rehash [client] port=3306 socket=/opt/mysql-5.7.39/run/mysql.sock [mysqld] basedir=/opt/mysql-5.7.39 datadir=/opt/mysql-5.7.39/data tmpdir=/opt/mysql-5.7.39/tmp lc_messages=zh_CN lc_messages...
no-auto-rehash 四、结论 通过本文档,我们可以实现 Centos5.6 x86_64 操作系统下部署安装 DRBD+Heartbeat+MySQL 服务器平台,实现服务器平台的高可用性和高性能。同时,本文档还提供了一些有用的经验和建议,旨在...
no-auto-rehash [client] socket=/tmp/mysql.sock ``` - 保存并关闭文件。 3. **初始化MySQL数据库**: - 打开命令提示符,切换到MySQL安装目录下的bin文件夹。 - 输入命令`mysqld --initialize-insecure`,...
no-auto-rehash default-character-set=utf8 ``` 4. **重启MySQL服务使更改生效**: - 运行命令`/etc/init.d/mysql restart`重启MySQL服务。 5. **验证字符集设置**: - 登录MySQL服务器,执行`show variables ...
- **no-auto-rehash**:禁用自动重哈希功能,可提高命令解析速度。该选项在交互式模式下特别有用,能减少因动态重哈希带来的性能损耗。 ##### 3. **[mysqld]** - **user=mysql**:指定MySQL服务启动时使用的用户...
no-auto-rehash [mysqld] user=mysql port=3306 basedir=/usr/local/mysql datadir=/data/mysql/ socket=/tmp/mysql.sock character_set_server=utf8mb4 skip_name_resolve=1 open_files_limit=65535 ...
no-auto-rehash prompt="\\u@\\h:\\d> " ``` 2. **启动MySQL服务**:可以通过以下命令启动MySQL服务: ```bash /usr/local/mysql/bin/mysqld_safe & ``` 3. **连接MySQL并更改密码**:使用临时密码连接...
no-auto-rehash ``` 开启自动补齐功能: ```plaintext [mysqld_safe] pid-file=/u01/mysql/3306/run/mysqld.pid open-files-limit=10240 ``` 增加每个进程的可打开文件数量,以适应打开大量表的需求...
- **no-auto-rehash**: 关闭自动哈希功能。 - **myisamchk**: MyISAM表检查工具配置。 - **key_buffer_size**: 类似于服务端配置。 - **sort_buffer_size**: 类似于服务端配置。 - **read_buffer**: 读取MyISAM...
- **no-auto-rehash**: 禁用自动重哈希功能,可以减少命令输入时的提示信息。 ##### 3. [mysqld] MySQL服务器配置 - **user**: 指定运行MySQL服务器进程的系统账户。 - **port**/**socket**: 与`[client]`部分相同...
这将开启自动完成的功能,取消注释掉之前的`#no-auto-rehash`。 3. **重启MySQL服务**: - 修改完配置文件后,同样需要重启MySQL服务使更改生效。通过命令`sudo /usr/local/mysql/support-files/mysql.server ...