创建存储过程: DELIMITER $$ USE `database_name`$$ DROP PROCEDURE IF EXISTS `add_or_update_user`$$ )) BEGIN INSERT INTO USER(`id`,`username`,`created`) VALUES(id,username,UNIX_TIMESTAMP(NOW())) ON DUPLICATE KEY UPDATE id=VALUES(id), username=VALUES(username)…