There was a problem with PHP even with MySQL:
PHP Fatal error:uncaught exception ' pdoexception ' with message ' sqlstate[hy000]: General error:1267 illegal mix of Colla tions (utf8_general_ci,implicit) and (utf8_unicode_ci,implicit) for operation ' = '
MySQL Status:
show variables like ' colla% '; +----------------------+----------------- +| variable_name | Value |+----------------------+-----------------+| collation_connection | Utf8_general_ci | | Collation_database | Utf8_unicode_ci | | Collation_server | Utf8_unicode_ci |show variables like ' char% '; +--------------------------+----------------------------+| variable_name | Value |+--------------------------+----------------------------+| character_set_client | UTF8 | | character_set_connection | UTF8 | | Character_set_database | UTF8 | | Character_set_filesystem | binary | | Character_set_results | UTF8 | | Character_set_server | UTF8 | | Character_set_system | UTF8 | | Character_sets_dir | /usr/share/mysql/charsets/|
Related stored procedure Code:
CREATE PROCEDURE `proc_str`(in strrr varchar(30) ,in useriid varchar(30))begindeclare i int;SET i=1;update imgupdate.bullentin set BoardPosition=replace(BoardPosition,concat(',',substring_index(strrr,',',1),','),',') where GroupUsers=useriid ;//replace过程出错while(select (length(strrr) -length(substring_index(strrr,',',i))) )>0 doset i=i+1;update imgupdate.bullentin set BoardPosition=replace(BoardPosition,concat(',',(substring(substring_index(strrr,',',i),length(substring_index(strrr,',',i-1))+2)),','),',') where GroupUsers=useriid ;end while;select 1;end;
Reply content:
There was a problem with PHP even with MySQL:
PHP Fatal error:uncaught exception ' pdoexception ' with message ' sqlstate[hy000]: General error:1267 illegal mix of Colla tions (utf8_general_ci,implicit) and (utf8_unicode_ci,implicit) for operation ' = '
MySQL Status:
show variables like ' colla% '; +----------------------+----------------- +| variable_name | Value |+----------------------+-----------------+| collation_connection | Utf8_general_ci | | Collation_database | Utf8_unicode_ci | | Collation_server | Utf8_unicode_ci |show variables like ' char% '; +--------------------------+----------------------------+| variable_name | Value |+--------------------------+----------------------------+| character_set_client | UTF8 | | character_set_connection | UTF8 | | Character_set_database | UTF8 | | Character_set_filesystem | binary | | Character_set_results | UTF8 | | Character_set_server | UTF8 | | Character_set_system | UTF8 | | Character_sets_dir | /usr/share/mysql/charsets/|
Related stored procedure Code:
CREATE PROCEDURE `proc_str`(in strrr varchar(30) ,in useriid varchar(30))begindeclare i int;SET i=1;update imgupdate.bullentin set BoardPosition=replace(BoardPosition,concat(',',substring_index(strrr,',',1),','),',') where GroupUsers=useriid ;//replace过程出错while(select (length(strrr) -length(substring_index(strrr,',',i))) )>0 doset i=i+1;update imgupdate.bullentin set BoardPosition=replace(BoardPosition,concat(',',(substring(substring_index(strrr,',',i),length(substring_index(strrr,',',i-1))+2)),','),',') where GroupUsers=useriid ;end while;select 1;end;
charset= ' UTF8 ' in Connect