show variables where variable_name = 'basedir'; 使用上面语句可以查询到Mysql的安装路径(如下图)。 参考: Server System VariablesSHOW VARIABLES Syntax