Edgewall Software

Changes between Version 47 and Version 48 of MySqlDb


Ignore:
Timestamp:
Feb 5, 2010, 12:53:19 PM (14 years ago)
Author:
anatoly techtonik <techtonik@…>
Comment:

update information about how to test DB collations

Legend:

Unmodified
Added
Removed
Modified
  • MySqlDb

    v47 v48  
    1818The recommended versions of MySQL are those from 5.0.x series.
    1919It might work with 4.1.x or 6.0.x, but no guarantees.
    20 It seems that some users were using the [http://askmonty.org/wiki/index.php/MariaDB MariaDB] variant of MySQL, but again, no guarantees.
     20Some users reported that [http://askmonty.org/wiki/index.php/MariaDB MariaDB] variant of MySQL works as well, but again, no guarantees.
    2121
    2222To avoid unicode and international characters problems in Trac (e.g., international characters turning into question marks with mysterious "Incorrect string value" errors logged), the Trac database MUST be configured  with the ''`utf8`'' character set and the ''`utf8_bin`'' collation type. All tables MUST be created as  '''InnoDB''' or '''NDB''' type tables, because Trac uses a transaction mechanism that is not supported by MyISAM tables (see [comment:ticket:8067:5] and [http://dev.mysql.com/tech-resources/articles/storage-engine/part_3.html MySQL docs]).
    2323
    24 A proper database can be created with the MySQL monitor, like this:
     24A proper database can be created with any MySQL client, like this:
    2525{{{
    2626CREATE DATABASE trac DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
     
    3131mysql> USE trac;
    3232Database changed
    33 mysql> SHOW VARIABLES LIKE '%character%';
    34 +--------------------------+--------------------
    35 | Variable_name            | Value
    36 +--------------------------+--------------------
    37 | character_set_client     | cp1251
    38 | character_set_connection | cp1251
    39 | character_set_database   | utf8
    40 | character_set_filesystem | binary
    41 | character_set_results    | cp1251
    42 | character_set_server     | utf8
    43 | character_set_system     | utf8
    44 | character_sets_dir       | C:\DevServer\Instal
    45 +--------------------------+--------------------
    46 8 rows in set (0.00 sec)
     33mysql> SHOW VARIABLES WHERE variable_name IN ('character_set_database', 'collation_database');
     34+------------------------+----------+
     35| Variable_name          | Value    |
     36+------------------------+----------+
     37| character_set_database | utf8     |
     38| collation_database     | utf8_bin |
     39+------------------------+----------+
     402 rows in set (0.01 sec)
     41
    4742mysql>
     43}}}
     44
     45If you are setting new collation on old database, make sure that columns are converted too:
     46{{{
     47mysql> SHOW FULL COLUMNS FROM `node_change`;
     48+-------------+-------------+-----------+-
     49| Field       | Type        | Collation |
     50+-------------+-------------+-----------+-
     51| rev         | varchar(64) | utf8_bin  |
     52| path        | text        | utf8_bin  |
     53| node_type   | varchar(32) | utf8_bin  |
     54| change_type | varchar(32) | utf8_bin  |
     55| base_path   | text        | utf8_bin  |
     56| base_rev    | varchar(64) | utf8_bin  |
     57+-------------+-------------+-----------+-
     586 rows in set (0.00 sec)                 
    4859}}}
    4960