Bug #22893
closedCore: Could not initialize DB connection with query "SET CHARACTER SET utf8 ...
0%
Description
Even the config works with typo3 4.3.3 it does not work with typo3 4.4 beta3 (s. error message from the logfile further below)
The setting works for typo3 4.3.3: [SYS][setDBinit] = SET CHARACTER SET utf8; SET NAMES utf8;
---
15-06-10 20:27 - Core: Could not initialize DB connection with query "SET CHARACTER SET utf8; SET NAMES utf8;": You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SET NAMES utf8' at line 1
15-06-10 20:27 - Core: Could not initialize DB connection with query "SET CHARACTER SET utf8; SET NAMES utf8;": You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SET NAMES utf8' at line 1
---
regards,
Mark
MySQL log:
---
100615 20:27:23 283 Connect typo3dbadmin@localhost on
283 Query SET CHARACTER SET utf8; SET NAMES utf8
283 Init DB domain_comch
283 Query SET CHARACTER SET utf8; SET NAMES utf8
283 Query show databases
283 Init DB information_schema
283 Init DB domain_comch
---
(issue imported from #M14740)
Updated by Chris topher over 14 years ago
Missing linefeed between the two commands?
Updated by Mark Iron over 14 years ago
It also does not work if both commands are in separate lines like:
---
SET NAMES utf8;
SET CHARACTERS SET utf8;
---
The install tool simply adds chr(10) after saving the config .. like:
SET CHARACTER SET utf8;'.chr(10).'SET NAMES utf8;
but the error message is similar:
---
15-06-10 21:06 - Core: Could not initialize DB connection with query "SET CHARACTER SET utf8;'.chr(10).'SET NAMES utf8;": You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''.chr(10).'SET NAMES utf8' at line 1
---
Updated by Chris topher over 14 years ago
The command
SET CHARACTER SET utf8;
is superfluous. Don't use it. Does it work without it?
Updated by Mark Iron over 14 years ago
It works if there is only one command. It could be "SET character set utf8;" or "SET NAMES utf8;"