DROP PROCEDURE IF EXISTS change_password;
DELIMITER $$
create procedure change_password()
begin
declare temp_id int;
declare done int default 0;
declare s_list cursor for select user_id from test_jdbc.new_user;
declare continue handler for not found set done = 1;
open s_list;
fetch s_list into temp_id;
while done <> 1 do
update test_jdbc.new_user set password=MD5('admin') where user_id=temp_id;
fetch s_list into temp_id;
end while;
end$$
DELIMITER ;
call change_password();