MySQL 一键卸载 设计思想 1、关闭数据库服务、根据 etc/my.cnf 参数文件找到对应目录 mysql.server stop cat /etc/my.cnf | grep -Ev '^#' |awk -F 'datadir=' '{print $2}'| grep -v '^$'|head -n 1 cat /etc/my.cnf | grep -Ev '^#'