Create User with Stored Procedure
i need have a stored procedure for create user , but i have unexpected error!!! :(
this is my sp:
CREATE DEFINER = `root` @`localhost` PROCEDURE `P_CreateUser3` (
IN _Username NVARCHAR (30),
IN _Password NVARCHAR (32) IN _DBName VARCHAR (20)
)
BEGIN
CREATE USER _Username @'localhost' IDENTIFIED BY _Password ;
GRANT
SELECT,
UPDATE,
DELETE,
INSERT
ON
`programmer`.*
TO
_Username @'localhost'
WITH
GRANT OPTION ;
END $$
and this is error:
Error Code: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IN _DBName VARCHAR (20)
)
BEGIN
CREATE USER _Username @'localhost' IDENTIFIED' at line 3
help me please.
Subject
Views
Written By
Posted
Create User with Stored Procedure
3020
July 06, 2012 11:55AM
1196
July 06, 2012 12:11PM
1051
July 06, 2012 12:21PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.