utf 8 - charsets in MySQL replication -


What can I do to make sure replication will use latin1 instead of utf-8?

I am migrating between a MySQL 5.1.22 server (Master) and a FreeBSD system on a Linux system between a MySQL 5.1.42 server (slave). My replica works well, but when non-ASCY characters are in my boards, they become "weird" Linux / MySQL-5.1.22 shows the following character set variables:

  character_set_client = latin1 character_set_connection = latin1 character_set_database = latin1 character_set_filesystem = binary character_set_results = latin1 character_set_server = latin1 character_set_system = UTF8 character_sets_dir = / usr freebad shows that 

  character_set_client = utf8 character_set_connection = Utf8 character_set_database = utf8 / share / mysql / charsets / collation_connection = latin1_swedish_ci collation_database = latin1_swedish_ci collat Ion_server =  

Character_set_filesystem = binary character_set_results = utf8 character_set_server = utf8 character_set_system = utf8 character_sets_dir = / usr / local / share / mysql / charsets / collation_connection = utf8_general_ci collation_database = utf8_general_ci collation_server = utf8_general_ci

None of these settings have any effect from MySQL CLI, and they may not begin to be created in my.cnf or on the command line when S creates.

Of course, the tables in question are created equally in both servers, in this case with DEFAULT CHARSET = latin1, I would like to give you an example:

  create table 'Test' ('test' varchar (5) DEFAULT NULL) ENGINE = MyISAM DEFAULT CHARSET = latin1  

When I on Master, in the Latin 1 terminal, "Test value ('ø') Enter it, it happens at slaves, when I select it from the Latin-based terminal

  + -------- + | test | + ------ - + | ÃÆ'Ã, ¥ | + ------- - +  

Testing on a UTF-8 based terminal on replication slave is included:

  + -------- + | test | + -------- + | Æøå | + -------- +  

So my conclusion is that it is converted to utf8, even if The definition of the table is Latin 1. Is this the correct conclusion?

Of course, on the master, in the Latin 1 terminal, it still says:

  + - Since ---- + | testing | + ------ + | Æøå | + ------ +  

Since both the system characters are utf-8 If i For the utf-8, both the terminals were established and then the "test value (inserting in 'æøå')" with a utf-8 terminal, with utf-8 i slave over:

  + ------------ + | Test | + ------------ + | øø¸¸¸¸ + ------------ +  

If my conclusion is correct, all my repetitive data is converted to utf8 (if it is UTF 8 , Then it is considered as Latin 1 and converted to UTF 8), whereas the table contains all the old data, as the CREATE TABLE suggests, latin1 I would love to convert it to all UTF-8 if this is not the case That legacy applications are trusted in Latin 1, then I need to keep it in Latin 1 Is required, while they still exist.

What can I do to make sure that the replica reads Latin 1, it considers it Latin 1 and writes it as a slave on Latin 1?

Cheers

Nick

Normally, you (The slave should use the same configuration file and mysql version of the upgrade / migration scenarios, and except for some things that need to be separated on slaves like Server_id.)

You can script your database setup So that your DB server is part of your software deployment. It is imperative that all those database servers with non-production environments use the exact same configuration.

Failure to sync config will result in unexpected bug

I do not know why you feel you need to run different OS on your own server, but if you If you do this then you are making life more difficult for your Ops employees.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -