mysql 自动补全工具 mycli

方法1.设置配置文件

mysql> select version();
+-----------+
| version() |
+-----------+
| 5.1.73    |
+-----------+
1 row in set (0.05 sec)


vi /etc/my.cnf 

[mysql] 

auto-rehash #添加auto-rehash

重启mysql 


可以补全表名,列名了:

+----------------+
| Tables_in_test |
+----------------+
| Customers      |
| OrderItems     |
| Orders         |
| Products       |
| Vendors        |
+----------------+
5 rows in set (0.00 sec)

mysql> select * from Order
OrderItems             OrderItems.order_item  OrderItems.prod_id     Orders                 Orders.order_date      
OrderItems.item_price  OrderItems.order_num   OrderItems.quantity    Orders.cust_id         Orders.order_num       
mysql> select * from Order
 
  

 但是无法补全sql 关键字: 


+----------------+
| Tables_in_test |
+----------------+
| Customers      |
| OrderItems     |
| Orders         |
| Products       |
| Vendors        |
+----------------+
5 rows in set (0.00 sec)

mysql> sel     //无法补全关键字

据说,mysql 5.6以上版本可以,以后试试。

参考   http://bbs.51cto.com/thread-927116-1.html


方法2: 安装mycli

https://jingyan.baidu.com/article/b7001fe1ae01df0e7282dd2b.html


登录: mycli  -u root 




一开始遇到个问题:

mysql root@localhost:test> select * from Orders;
+-----------+---------------------+------------+
| order_num | order_date          | cust_id    |
+-----------+---------------------+------------+
| 20005     | 2012-05-01 00:00:00 | 1000000001 |
| 20006     | 2012-01-12 00:00:00 | 1000000003 |
| 20007     | 2012-01-30 00:00:00 | 1000000004 |
| 20008     | 2012-02-03 00:00:00 | 1000000005 |
| 20009     | 2012-02-08 00:00:00 | 1000000001 |
+-----------+---------------------+------------+
5 rows in set
Time: 0.016s
mysql root@localhost:test> select * cust_    //无法补全

看了下官方文档,要出现特定的关键字后才能http://www.mycli.net/completion

select * cust_  from  `Orders`; 








你可能感兴趣的:(mysql 自动补全工具 mycli)