• Joomla problem - in MySql - wrong collation - latin1_swedish_ci to utf8_general_ci for all the tables in one of the db instances

    The problem is that the hoster creates the db in the wrong collation , therefore no hebrew is possible for me in my sites , which is not to good , considering my business is primarily in Israel .
    I've been trying to solve it with a one single query, but with no luck.
    There are a few solutions through php scripts, witch you are placing on the host and activating from there.
    I worked at MySql side only.
    So , a few steps for workaround ..
    1). Get the list of the tables from your information_schema , that is being provided by the hoster. The query would look like -

    SELECT table_name
    FROM information_schema.tables
    WHERE TABLE_TYPE = 'BASE TABLE'
    AND TABLE_SCHEMA = 'Your_DB_Name_Goes_Here'
    and TABLE_COLLATION <> 'utf8_general_ci'

    Run it through the sql window of PhpMyAdmin.

    You'll get the list of a specific database tables , which are not defined with 'utf8_general_ci' Collation.

    2).At the bottom of the list activate the export . Export to CSV.

    3).Very basic - enter xsl ,
    write down (leaving blanks as blank columns)
    first column second column blank column for table name forth column
    ALTER TABLE here4u_jo151.___________ DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;

    4).Pull it down for as much rows as the number of the tables you got, for your db_name before.

    5).Just pour out to the blank column all the table_names.

    6).Take all the queries to Sql of the PhpMyAdmin and run it.
    (Be careful, put ',' at the end of each line ; pay attention that there are no blanks between the db name and the table name in the queries from excel.)

0 comments:

Leave a Reply

Thanks for sharing your feedback! If your feedback doesn't appear right away, please be patient as it may take a few minutes to publish - or longer if the blogger is moderating comments.