61.MySQL-Utilities工具包之-mysqlmetagrep模糊查询

1.搜索数据库:mysqlmetagrep
mysqlmetagrep --pattern="%test%" --server=root:rootroot@192.168.1.51:3306
1.数据库,表,视图等名称中有:test的内容。
[root@mysql1 ~]# mysqlmetagrep --pattern="%test%" --server=root:rootroot@192.168.1.51:3306
WARNING: Using a password on the command line interface can be insecure.
+---------------------------+--------------+-------------------+-----------+-------------+-------------------+
| Connection                | Object Type  | Object Name       | Database  | Field Type  | Matches           |
+---------------------------+--------------+-------------------+-----------+-------------+-------------------+
| root:*@192.168.1.51:3306  | SCHEMA       | test              | test      | DATABASE    | test              |
| root:*@192.168.1.51:3306  | SCHEMA       | test2             | test2     | DATABASE    | test2             |
| root:*@192.168.1.51:3306  | TABLE        | latest_file_io    | sys       | TABLE       | latest_file_io    |
| root:*@192.168.1.51:3306  | TABLE        | x$latest_file_io  | sys       | TABLE       | x$latest_file_io  |
| root:*@192.168.1.51:3306  | TABLE        | test1             | test      | TABLE       | test1             |
| root:*@192.168.1.51:3306  | TABLE        | test2             | test      | TABLE       | test2             |
| root:*@192.168.1.51:3306  | TABLE        | test3             | test      | TABLE       | test3             |
| root:*@192.168.1.51:3306  | TABLE        | test1             | test2     | TABLE       | test1             |
| root:*@192.168.1.51:3306  | VIEW         | latest_file_io    | sys       | VIEW        | latest_file_io    |
| root:*@192.168.1.51:3306  | VIEW         | x$latest_file_io  | sys       | VIEW        | x$latest_file_io  |
+---------------------------+--------------+-------------------+-----------+-------------+-------------------+

2.仅查看对象类型为:TABLE的内容。
mysqlmetagrep --search-objects=table --pattern="%itpux%" --server=root:rootroot@192.168.1.51:3306
[root@mysql1 ~]# mysqlmetagrep --search-objects=table --pattern="%test%" --server=root:rootroot@192.168.1.51:3306
WARNING: Using a password on the command line interface can be insecure.
+---------------------------+--------------+-------------------+-----------+-------------+-------------------+
| Connection                | Object Type  | Object Name       | Database  | Field Type  | Matches           |
+---------------------------+--------------+-------------------+-----------+-------------+-------------------+
| root:*@192.168.1.51:3306  | TABLE        | latest_file_io    | sys       | TABLE       | latest_file_io    |
| root:*@192.168.1.51:3306  | TABLE        | x$latest_file_io  | sys       | TABLE       | x$latest_file_io  |
| root:*@192.168.1.51:3306  | TABLE        | test1             | test      | TABLE       | test1             |
| root:*@192.168.1.51:3306  | TABLE        | test2             | test      | TABLE       | test2             |
| root:*@192.168.1.51:3306  | TABLE        | test3             | test      | TABLE       | test3             |
| root:*@192.168.1.51:3306  | TABLE        | test1             | test2     | TABLE       | test1             |
+---------------------------+--------------+-------------------+-----------+-------------+-------------------+

3.总结

mysqlmetagrep 工具可以同时查看TAB.VIEW,SCHEMA,FUNCTION等。通过模糊查询可以很方便的找到表,视图,数据库名称,函数名称等。四个比较综合性的工具,相对比较实用。特别是急不得表的具体名称。
 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值