Announcement

Collapse
No announcement yet.

Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (latin1_general_ci,IMPLICIT) for operation '='

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (latin1_general_ci,IMPLICIT) for operation '='

    Hey,

    Getting this when upgrading from vb 3.6.x to 4.2.1 on a localhost - I had to install an old version of PHP to run 3.6 so maybe this could be the cause for 4.2?


    Database error in vBulletin 4.2.1:

    Invalid SQL:

    (SELECT 'package' AS classtype, package.packageid AS typeid, package.packageid AS packageid,
    package.productid AS productid, if(package.productid = 'vbulletin', 1, product.active) AS enabled,
    package.class AS class, -1 as isaggregator
    FROM package AS package
    LEFT JOIN product AS product
    ON product.productid = package.productid
    WHERE product.active = 1
    OR package.productid = 'vbulletin'
    )

    UNION

    (SELECT 'contenttype' AS classtype, contenttypeid AS typeid, contenttype.packageid AS packageid,
    1, 1, contenttype.class AS class , contenttype.isaggregator
    FROM contenttype AS contenttype
    INNER JOIN package AS package ON package.packageid = contenttype.packageid
    LEFT JOIN product AS product ON product.productid = package.productid
    WHERE product.active = 1
    OR package.productid = 'vbulletin' );

    MySQL Error : Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (latin1_general_ci,IMPLICIT) for operation '='
    Error Number : 1267
    Request Date : Thursday, January 8th 2015 @ 11:18:29 PM
    Error Date : Thursday, January 8th 2015 @ 11:18:29 PM
    Script : http://127.0.0.1/vb4/upload/forum.php
    Referrer :
    IP Address : 127.0.0.1
    Username : John D
    Classname : vB_Database
    MySQL Version : 5.0.33
    John Diver

  • #2
    Fixed - Create a PHP script with the following:

    Code:
    <?php
    
    $database_name='your db name';
    $database_username='your username';
    $database_password='your password';
    
    $connection = mysql_connect('localhost',$database_username,$database_password);
    
    if(!$connection) {
        echo "Cannot connect to the database – incorrect details";
    } else{
        mysql_select_db($database_name);
        $result=mysql_query('show tables');
    
        while($tables = mysql_fetch_array($result)) {
    
            foreach ($tables as $key => $value) {
                mysql_query("ALTER TABLE ".$value." CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci");
            }
        }
    echo "Successfull collation change!";
    }
    ?>
    John Diver

    Comment


    • #3
      This fixed mine, thank you!

      Comment


      • #4
        Glad it worked
        John Diver

        Comment


        • #5
          it worked , thank you!
          Greek funny Forum

          Comment

          widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
          Working...
          X