DELIMITER $$
CREATE PROCEDURE insert_uc_user(IN max_num INT(10))
BEGIN
DECLARE i INT DEFAULT 0;
SET autocommit = 0;
REPEAT
SET i = i + 1;
INSERT INTO `yfxz_usercenter_dev`.`uc_user`(`id`, `sso_id`, `real_name`, `username`, `id_card`, `gender`, `email`, `telephone`, `station`, `create_time`, `modify_time`, `department`, `status`, `source`, `password`, `salt`, `end_time`, `notes`, `is_delete`, `open_ip_login`, `max_online_value`, `description`, `service_start_time`, `login_ip`, `job_name`) VALUES (155250053284870+i, NULL, 201905072002+i, CONCAT((201905072002+i),'@gridsum.com'), NULL, NULL, CONCAT((201905072002+i),'@gridsum.com'), CONCAT((13041279198+i),''), NULL, '2019-05-13 15:28:09', NULL, 149058849211392, 1, NULL, '6G/2DOD6KHd6a9J6xOz+MFWYo3Q=', 0x1EBE618E6FE5, NULL, NULL, 0, 0, NULL, NULL, NULL, NULL, '');
UNTIL i = max_num
END REPEAT;
COMMIT;
END $$
#删除
# DELIMITER ;
drop PROCEDURE insert_uc_user;
call insert_uc_user(30000)
过程插入几万条数据到mysql
最新推荐文章于 2021-03-23 17:16:28 发布