Hi there,
I want to give my database users the ability to change their passwords. I have set up the access to be allowed from localhost and any host (%) so I tried to set up a SP like this:
CREATE PROCEDURE `mydb`.`ChangePwd` (IN p VARCHAR(45))
BEGIN
SET PASSWORD FOR 'userx'@'localhost' = PASSWORD(p);
SET PASSWORD FOR 'userx'@'%' = PASSWORD(p);
END
But MySql always gives my an error 1064 saying that theres an error witn my syntax near (p). Any ideas?
I now that "set password for..." works for users that want to change their password for localhost access, but not for the entry 'username'@'%' so I want to use an SP that runs with root privileges.
I want to give my database users the ability to change their passwords. I have set up the access to be allowed from localhost and any host (%) so I tried to set up a SP like this:
CREATE PROCEDURE `mydb`.`ChangePwd` (IN p VARCHAR(45))
BEGIN
SET PASSWORD FOR 'userx'@'localhost' = PASSWORD(p);
SET PASSWORD FOR 'userx'@'%' = PASSWORD(p);
END
But MySql always gives my an error 1064 saying that theres an error witn my syntax near (p). Any ideas?
I now that "set password for..." works for users that want to change their password for localhost access, but not for the entry 'username'@'%' so I want to use an SP that runs with root privileges.