This is a read-only copy of the MariaDB Knowledgebase generated on 2024-11-16. For the latest, interactive version please visit https://mariadb.com/kb/.

Error on SINGAL permissions

Hi all,

I have this script

DROP DATABASE IF EXISTS `ERPUniversitario`;
CREATE DATABASE `ERPUniversitario` DEFAULT CHARACTER SET utf8 COLLATE utf8_spanish_ci;
DROP USER IF EXISTS 'ERPUniversitario'@'localhost';
CREATE USER 'ERPUniversitario'@'localhost';
SET PASSWORD FOR 'ERPUniversitario'@'localhost' = PASSWORD('ERPUniversitario');
GRANT USAGE ON `ERPUniversitario`.* TO 'ERPUniversitario'@'localhost';

DELIMITER |
DROP FUNCTION IF EXISTS `ERPUniversitario`.`faBecas_ResolucionesDetalleAprobar`; |
CREATE DEFINER = CURRENT_USER() FUNCTION `ERPUniversitario`.`faBecas_ResolucionesDetalleAprobar`() RETURNS TINYINT UNSIGNED
LANGUAGE SQL
DETERMINISTIC#NOT DETERMINISTIC
SQL SECURITY DEFINER#INVOKER
MODIFIES SQL DATA#READS SQL DATA
COMMENT 'Aprueba o imprueba un registro en la tabla'
BEGIN

  SET @`Error` := CONCAT('El usuario: no cuenta con permisos para ejecutar esta acción.');
  SIGNAL SQLSTATE VALUE '99999' SET MESSAGE_TEXT = @`Error`;
  RETURN 1;
END; |
GRANT EXECUTE ON FUNCTION `ERPUniversitario`.`faBecas_ResolucionesDetalleAprobar` TO 'ERPUniversitario'@'localhost'; |
DELIMITER ;

When I connect to localhost with the user ERPUniversitario I got the following error

MariaDB [(none)]> SELECT `ERPUniversitario`.`faBecas_ResolucionesDetalleAprobar`();
ERROR 1644 (99999): El usuario: no cuenta con permisos para ejecutar esta acción.

Any ideas?

Best regards

David

Answer Answered by David Villalobos Cambronero in this comment.

I have found the error, sorry.

Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.