Comments - Getting Help With MariaDB

1 year, 2 months ago flavio mesa

Hi everyone! I am having a problem scripting a create user's store procedure I have a SP that in some fragment creates a user like this:

SET @dinamic_sql = CONCAT("CREATE USER IF NOT EXISTS '",_User,"'@'localhost' IDENTIFIED BY '",_Passwd,"' DEFAULT ROLE 'USER_ROLE' ACCOUNT UNLOCK"); PREPARE create_user FROM @dinamic_sql; EXECUTE create_user; set @err = @err + @@error_count; -- this is 'cus it is inside a transaction DEALLOCATE PREPARE create_user; FLUSH PRIVILEGES;

But my problem is that when I try to run de SP it gives me sintaxis error near 'DEFAULT ROLE 'USER_ROLE' ACCOUNT UNLOCK' This happens on my Ubuntu Server

I also use MySql Workbench on a windows developer instance, but it runs without any problems

I have also checked the MariaDB documentation, and the create user's sintaxis is the same as MySql's one

If someone have any idea about what could be happening, 'cus it looks like MariaDB has something wrong

 
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.