title: How to fix "Illegal mix of collations (utf8_unicode_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation '='"
body: <p>While executing a stored procedure in MySQL on my remove server as below:</p>
  <pre><code>CREATE OR REPLACE PROCEDURE `SetNextPage`(
      IN `inRefNo` varchar(30) COLLATE utf8_general_ci,
      IN `inStage` varchar(40) COLLATE utf8_general_ci,
      IN `inRedirectTo` varchar(50) COLLATE utf8_general_ci,
      IN `inSurveyType` varchar(14) COLLATE utf8_general_ci
  )
  BEGIN
      IF inSurveyType = 'preinspection' THEN
          UPDATE preinspections SET Stage = inStage, RedirectTo = inRedirectTo WHERE RefNo = inRefNo;
      ELSE
          UPDATE surveys SET Stage = inStage, RedirectTo = inRedirectTo WHERE RefNo = inRefNo;
      END IF;
  END
  </code></pre>
  <p>I am receiving error message as:</p>
  <p><strong>Illegal mix of collations (utf8_unicode_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation '='</strong></p>
  <p>Here's a screenshot of tables in my database with query as below:</p>
  <pre><code>SELECT TABLE_NAME, TABLE_COLLATION
  FROM INFORMATION_SCHEMA.TABLES
  WHERE TABLE_SCHEMA=&quot;mydatabase&quot; AND TABLE_TYPE=&quot;BASE TABLE&quot;;
  </code></pre>
  <p><a href="https://i.stack.imgur.com/RvZql.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RvZql.png" alt="Screenshot of tables from phpMyAdmin" /></a></p>
  <p><em>This table <strong>quick_tables.bck</strong> is just stuck in there because of .bck in its name. But it is not being anywhere in my code.</em></p>
  <p>Here's the snapshot of system variables with an SQL query as below:</p>
  <pre><code>SHOW VARIABLES WHERE Variable_name LIKE (&quot;character%&quot;) OR Variable_name LIKE (&quot;Collation%&quot;);
  </code></pre>
  <p>Variable_name               <strong>Value</strong><br />
  character_set_client        <strong>utf8</strong><br />
  character_set_connection    <strong>utf8</strong><br />
  character_set_database      <strong>utf8</strong><br />
  character_set_filesystem    <strong>binary</strong><br />
  character_set_results       <strong>utf8</strong><br />
  character_set_server        <strong>latin1</strong><br />
  character_set_system        <strong>utf8</strong><br />
  character_sets_dir          <strong>/usr/share/mysql/charsets/</strong><br />
  collation_connection        <strong>utf8_unicode_ci</strong><br />
  collation_database          <strong>utf8_general_ci</strong><br />
  collation_server            <strong>latin1_swedish_ci</strong></p>
  <p><strong>Being on remote server with Shared Hosting, I cannot change environmental variables.</strong></p>
  <p>What changes should I make to make my stored procedure to run?</p>