I
I
Igor Vasiliev2017-09-18 16:25:32
MySQL
Igor Vasiliev, 2017-09-18 16:25:32

How to change non-changing encoding in MySQL?

Hello.
-
Faced in the first such an anomaly.
As always, I created a table in utf8_general_ci encoding , both the table and the rows in it utf8_general_ci, the text readable on the site, without korakozyabr, the site was made on the IDE, that is, in the settings everything is created in utf-8, this is automatic and not even discussed. So everywhere everything is set up correctly, but the trouble is, an error occurs that I have data in the wrong encoding, when I want to edit it, and when viewing the encoding is readable, I made a dump,

array(139) {
    ["id"]=>
    int(1)
    ["marker"]=>
    string(9) "0-1000095"
    ["link"]=>
    string(12) "num0_1000095"
    ["standart"]=>
    string(15) "ГОСТ 520-89"
    ["str_m"]=>
    string(6) "0,0025"
    ["str_d"]=>
    string(1) "5"
    ["str_h"]=>
    string(2) "13"
    ["str_b"]=>
    string(1) "4"
    ["sort_podhibnil"]=>
    string(33) "подшипник качения"
    ["sort_body_kachenia"]=>
    string(18) "шариковый"
    ["sort_power_nagruzki"]=>
    string(20) "радиальные"
    ["riadnosty"]=>
    string(20) "однорядный"
    ["ispolnenie"]=>
    string(66) "основное конструктивное исполнение"

it feels like the table is in windows-1251
The encoding is utf8_general_ci in the database .
I made a sql query:
ALTER TABLE `mydatabase`.`auth_group_permissions` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;

It wasn't there!!!! 0 rows affected! Charles! ZERO!
I go back to the database, the text in the table is normal, I check through the operations, I check line by line - everything is fine. I uploaded a csv file through the database. It's funny that I did the same with other tables, but this one shows such strange things. I can’t understand what her problem is, where to knock or crank so that this glitch stops, maybe something is stuck somewhere))) I can only laugh. Well, because THIS is a frankly strange thing.
Question:
How to change the non-changing encoding? Has anyone already encountered this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Igor Vasiliev, 2017-09-22
@Isolution666

Bottom line: if someone faced such a problem as mine:
.htaccess of the root directory, specify AddDefaultCharset UTF-8

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question