今天在看mysql的配置文件的时候,发现有"auto-rehash"不明白什么意思,在此记录一下,auto-rehash是自动补全的意思,就像我们在linux命令行里输入命令的时候,使用tab键的功能是一样的,例如mysql> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> select host
host.Alter_priv host.Alter_routine_priv host.Create_priv host.Create_routine_priv
host.Create_tmp_table_priv host.Create_view_priv host.Db host.Delete_priv
host.Drop_priv host.Execute_priv host.Grant_priv host.Host
host.Index_priv host.Insert_priv host.Lock_tables_priv host.References_priv
host.Select_priv host.Show_view_priv host.Trigger_priv host.Update_priv
host
mysql> select host
默认是不使用自动补全功能的,这个参数在配置文件中的[mysql]下面。如:
my.cnf示例片段:
[mysql]
prompt=[\h][\u]@\d\r:\m:\s>
no-auto-rehash
[client]
port=3306
socket=/data/mysql/mysql.sock
[mysqld]
user=mysql
port=3306
slow_query_log_file=mysql.slow
log-bin=mysql-bin
binlog-format=STATEMENT
skip-name-resolve
log-error=mysql.err
default-storage-engine=INNODB
character-set-server=utf8
long_query_time=1
slow_query_log=1
innodb_data_file_path=ibdata1:100M:autoextend
innodb_log_file_size=1G
innodb_file_per_table=1
datadir=/data/mysql/
innodb_data_home_dir=/data/mysql/
innodb_log_group_home_dir=/data/mysql/
pid-file=/data/mysql/mysql.pid
socket=/data/mysql/mysql.sock
innodb_buffer_pool_size=512M