I create a user to make a dump twice a week but when I try to execute mysqldump I have this error
mysqldump: Couldn't execute 'SHOW FIELDS FROM
contabilidad_amortizaciones_completas_por_id_vista
': execute command denied to user 'dump'@'%' for routine 'bbbdd57_antes_del_cambio.calcula_dotacion_acumulada_fc' (1370)
The grants to this user are these
GRANT SELECT, SHOW DATABASES, LOCK TABLES, EVENT ON *.* TO 'dump'@'%'
The function call 'bbbdd57_antes_del_cambio.calcula_dotacion_acumulada_fc' have this code:
CREATE DEFINER = 'root'@'%'
FUNCTION
bbbdd57_antes_del_cambio.calcula_dotacion_acumulada_fc(_id_amortizacion int)
RETURNS decimal(10,2)
BEGIN
SET @resultado = 0;
( SELECT SUM(R.acumulado) FROM (
SELECT MAX(cadm
.acumulado
) AS acumulado
,
cadm.id_amortizacion
FROM contabilidad_amortizaciones_detalles_meses
cadm
WHERE ((cadm
.id_amortizacion
= _id_amortizacion)
AND (cadm
.contabilizado
= 1))
GROUP BY cadm
.anio_detalle
, cadm
.contabilizado
) AS R
GROUP BY R.id_amortizacion INTO @resultado
);
RETURN @resultado;
END
I have other instances with other users-dump with this permissions and I don't have any problem.
Asked by monchyrcg
(31 rep)
May 29, 2018, 08:46 AM
Last activity: Jul 12, 2025, 03:51 PM
Last activity: Jul 12, 2025, 03:51 PM