L
L
LamerFromSpace2019-07-05 16:33:37
linux
LamerFromSpace, 2019-07-05 16:33:37

Why is Cyrillic not inserted into mysql columns?

I do INSERT in the table, all fields are adequately interposed, except for lines in Cyrillic, in these places empty columns. Latin is ok.
Terminal in utf-8
file /etc/mysql/my.cnf:

[mysqld]
character-set-server=utf8
collation-server=utf8_general_ci
init-connect="SET NAMES utf8"
skip-character-set-client-handshake

[mysql]
default-character-set = utf8

[client]
default-character-set = utf8

[mysqldump]
default-character-set = utf8

In mysql itself:
mysql> SHOW VARIABLES LIKE 'char%';
+--------------------------+----------------------------+
| Variable_name            | Value                      |
+--------------------------+----------------------------+
| character_set_client     | utf8                       |
| character_set_connection | utf8                       |
| character_set_database   | utf8                       |
| character_set_filesystem | binary                     |
| character_set_results    | utf8                       |
| character_set_server     | utf8                       |
| character_set_system     | utf8                       |
| character_sets_dir       | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
8 rows in set (0.02 sec)

INSERT:
INSERT INTO `Tovar` (`name`,`price`) VALUES
('Гвозди','34'),
('Молоток','150'),
('Лопата','100');

SELECT output:
mysql> SELECT * FROM Tovar;
+----+------+-------+
| id | name | price |
+----+------+-------+
|  1 |      |    34 |
|  2 |      |   150 |
|  3 |      |   100 |
+----+------+-------+
3 rows in set (0.00 sec)

UPD:
I understand what's the matter, when I insert INSERT into the mysql console - it cuts off the Cyrillic alphabet:
mysql> INSERT INTO `Tovar` (`name`,`price`) VALUES
    -> ('','34'),
    -> ('','150'),
    -> ('','100'),

How to decide?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
ThunderCat, 2019-07-05
@ThunderCat

locale -c charmap
locale -a

what outputs?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question