Announcement

Collapse
No announcement yet.

mysql error after upgrade

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

  • [Forum] mysql error after upgrade

    We just upgraded a site from vb3 to vb4 things didnt go too well as there was a bug in the upgrade script i believe.

    Trying to access posts receiving the following error, has anyone encountered this before and if so how to fix.


    Currently all old mods are turned off

    Code:
    Database error in vBulletin 4.1.2:
    
    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 (utf8_unicode_ci,IMPLICIT) for operation '='
    Error Number  : 1267
    Request Date  : Friday, March 25th 2011 @ 02:34:33 PM
    Error Date    : Friday, March 25th 2011 @ 02:34:33 PM
    Script        : http://www.fish-keeping.com/forums/showthread.php?6-Which-one
    Referrer      : http://www.fish-keeping.com/forums/forumdisplay.php?3-Main-Site-Polls
    IP Address    : 78.150.241.14
    Username      : Reddevil
    Classname     : vB_Database
    MySQL Version : 4.1.12-log
    http://www.vrbforums.com/forum/index.php

  • #2
    When vBulletin creates a new table in the upgrade process, it asks MySQL what the default collation for the database is and then uses that. Most MySQL installations default to latin1_swedish_ci. If you have changed collations for any reason on tables in the past then you should change the database to use that as the default to prevent this issue from happening in the future.

    You will find more information in the MySQL manual here:
    http://dev.mysql.com/doc/refman/5.1/en/charset.html

    You will need to use phpMyAdmin and make sure that all tables and fields within them have the same collation. Make sure your database collations are appropriate and consistent throughout the entire database. You need to use program like phpmyadmin to view your collations:

    http://www.phpmyadmin.net/home_page/index.php

    When you click your database name in phpmyadmin it will list all tables, their collations, as well as the collation of the database itself at the bottom. And when you click the name of a table on the left it will list the collations of individual fields within that table.

    1) To edit the collation of the database itself you need to click the database name on the left and then click "Operations" on the top.

    2) To edit the collation of an individual table you need to click its name on the left and then click "Operations" on the top.

    3) To edit the collation of an individual field within a table you need to click the table name on the left and then click the edit image (a little pencil icon) for that field.

    For more information please see: http://www.vbulletin.com/forum/showt...ight=collation

    Note: It is very very very important to make full database backups before proceeding if you are ever manually making any changes to your database, let it be issuing queries, or editing it via phpMyAdmin or any other interface. If done incorrectly, manually modifying the database can potentially cause irreversible damage to your database, and there is no way to perform a "partial restore" to restore just the part you may break.
    Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
    Change CKEditor Colors to Match Style (for 4.1.4 and above)

    Steve Machol Photography


    Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


    Comment


    • #3
      Thanks for the info Steve.
      http://www.vrbforums.com/forum/index.php

      Comment

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