1. After a successful creation of the stored procedure, use the call stored procedure name to execute the Times error:
Illegal mix of collations (utf8_unicode_ci,implicit) and (utf8_general_ci,implicit) errors.
Workaround: Check the encoding of the table used by the stored procedure, including the fields and the table itself. The final unified encoding method. After the type is a character, string, and so on, addCHARSET UTF8Example:
DELIMITER $$
USE `mall`$$
DROP PROCEDURE IF EXISTS `Prc_AddArticleInfo`$$
create definer= ' root ' @ ' localhost ' PROCEDURE ' Prc_addarticleinfo ' (snames text CHARSET utf8,contents text CHARSET utf8,createdtimes datetime,,urls TEXT CHARSET utf8, CAGs varchar (32 CHARSET UTF8 ,usernames varchar (32 ) CHARSET utf8)
BEGIN
DECLARE userids INT DEFAULT 0;
DECLARE genreids INT DEFAULT 0;
DECLARE sname TEXT CHARSET utf8 DEFAULT NULL;
DECLARE scontent TEXT CHARSET utf8 DEFAULT NULL;
DECLARE screatedtime TEXT CHARSET utf8 DEFAULT NULL;
DECLARE svoidtime TEXT CHARSET utf8 DEFAULT NULL;
DECLARE surl TEXT CHARSET utf8 DEFAULT NULL;
DECLARE username VARCHAR(32) CHARSET utf8 DEFAULT NULL;
DECLARE cag VARCHAR(32) CHARSET utf8 DEFAULT NULL;
SET sname=snames;
SET scontent=contents;
SET screatedtime=createdtimes;
SET svoidtime=voidtimes;
SET surl=urls;
SET username=usernames;
SET cag=cags;
SELECT id INTO genreids FROM genres WHERE NAME=cag;
SELECT admin_user_id INTO userids FROM admin_user WHERE admin_user_name=username;
insert into Article (name,content,createdtime,voidtime,url,genreid,userid) Values ( sname,scontent, Screatedtime,svoidtime,surl ,genreids,userids
END$$
DELIMITER ;
2.mysql report fatal error encountered during command execution solution
In the connection string, add
Allow User variables=true
Solve.
Otherwise, occasionally the error, the stored procedure name is a bit of error, and the Times do not report, the parameters of the 1-digit number of normal 2-digit error, etc...
Problems with MySQL creating stored procedures