安装:
yum -y install mlocate
安装完以后更新库:
updatedb
如果不更新,会报如下错误:
[root@yunwei ~]# locate my.cnf
locate: can not stat () `/var/lib/mlocate/mlocate.db': No such file or directory
好了,下边就可以正常使用了。 举例:
[root@yunwei src]# locate my.cnf
/etc/my.cnf
/etc/my.cnf.d
/etc/my.cnf.d/client.cnf
/etc/my.cnf.d/mysql-default-authentication-plugin.cnf
/etc/my.cnf.d/mysql-server.cnf