Error changing charset using Mysql Table Editor from latin1 to utf8

Asked

Viewed 245 times

0

I am trying to change the charset, of a table directly in the database using Mysql Table Editor, from latin1 to utf8 however, by selecting utf8 in the charset options it automatically changes the collation to utf8mb4_general_ci and by having the changes applied returns me following error:

collation para utf8mb4_general_ci is not valid for character set utf8

Among the dozens of collations existing in the collation option which should be the correct?

1 answer

0


So the correct is the one that attracts you, so it depends on the case any one can be the one such correct that you seek, now if you are wanting to use the pattern ABNT2 then a utf8 - default collation will solve.

Regarding error message, it seems you already have records in the table and these records cannot (is not valid) convert them to the other collation, a simple way to understand this is if you already have a type character c and wants to convert it to an American format where it does not exist, so it will generate an error.

but I’ll post a coded example:

ALTER TABLE `database`.`tabela` CHARACTER SET = utf8 ;

As per comments: php.ini file

has an excerpt of the code that must be commented, or if there is no

; PHP's default character set is set to empty.
; http://php.net/default-charset
;default_charset = "UTF-8"

Remove the character ; that is n beginning of the line ;default_charset = "UTF-8" and restart the apache service.

In the http.conf file there is also a line where a charset configuration is made:

#AddDefaultCharset utf-8

Same schema remove the first character and re-start the service

  • right, I chose utf8_general_ci in the collation. It was accepted. In the pages I put http-equiv meta="Content-Type" content="text/html; charset=utf-8" and in the pages it keeps appearing What else should I do?

  • changes php.ini settings, take a look there

  • Just remembering that we left the mysql tag of the statement we are entering into html and php

  • Boy! , are 1875 lines of pure English, understood bulufas, rs

  • rsrsr, just search for the keyword charset doesn’t have many lines on it =D

  • 1: ; PHP’s default Character set is set to Empty. ; http://php.net/default-charset ;default_charset = "UTF-8"

  • 2: ; Default charset for ibase_connect(). ;Ibase.default_charset =

  • 3: ; If Empty or not set the client charset from freetds.conf is used ; This is only used when Compiled with Freetds mssql.charset = "ISO-8859-1"

  • how do I restart or re-start? It does not serve to edit the file and save?

  • It will depend on the case, windows will on start->run and type services.Msc search for apache in the list and click the right restart button needs to be Administrator

  • if it’s linux, go to the shell and type service apache2 Restart needs to be root

  • kkkkk, sorry, is speaking Greek to me. It’s all there on the server.

  • yes it is on the server that makes this configuration

  • I’m gonna go check it out

Show 9 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.