Typo3 - Wechsel von Latin1 auf UTF-8 - MySQL und TYPO3 auf UTF-8 umstellen

Aus Carl-Christian Sautter - Wiki
Wechseln zu: Navigation, Suche

Error:

102: These fields are not properly updated in database: (bodytext) Probably value mismatch with fieldtype.

Solution: http://t3n.de/magazin/mysql-typo3-utf-8-umstellen-tipps-wechsel-latin1-utf-8-220945/3/

Zusammenfassung

  • Check MySQL Default Encoding
# mysql
SHOW VARIABLES LIKE 'character_set%';
SHOW VARIABLES LIKE 'collation%';
  • Set MySQL Default Encoding
default-character-set=utf8
collation-server = utf8_unicode_ci
init-connect='SET NAMES utf8'
character-set-server = utf8
default-character-set=utf8
  • Convert Typo3 Table
 mysqldump --compatible=mysql40 --opt -Q database > database.sql
 iconv -f iso-8859-1 -t utf8 database.sql > database-conv.sql
 # fix syntax changes
 sed -i -e 's/) TYPE=/) ENGINE=/' database-conv.sql
 # fix ENGINE Type
 sed -i -e 's/) ENGINE=MyISAM/) ENGINE=InnoDB/' database-conv.sql
  • Import fixed Typo3 Table
mysql --default-character-set=utf8 database < database-conv.sql