3

Have putty connection.
Putty config :
window-->translation-->remote character set-->utf-8
Launch command line MySQL client.
Perform insert with cyrillic like:

CREATE TABLE `category` (
  `catName` varchar(40) NOT NULL DEFAULT '',
  PRIMARY KEY (`catName`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

insert into category(catName) values ('абвгдйка');

The result is that corrupted cyrillic symbols inserted into DB.

6

By default MySQL server is using latin1 character set for each incoming connection. Latin1, as you might know, does not support cyrillic symbols.

The simplest solution is to switch so called 'connection character set' by running SET NAMES 'utf8'; in the beginning of each connection.

For example, this query should work:

SET NAMES 'utf8';

CREATE TABLE `category` (
  `catName` varchar(40) NOT NULL DEFAULT '',
  PRIMARY KEY (`catName`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

insert into category(catName) values ('привет русско-говорящему серверу');

To learn about character sets in MySQL and how to make the above change permament see here.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.