0

Upon installing LiteCart, an open-source shopping cart script, I get this error:

Checking MySQL version...

Fatal error: 1115 - Unknown character set: 'utf8';' set names 'utf8';

in /storage/h3/487/604487/public_html/shop/includes/library/lib_database.inc.php on line 220

Can someone help me understand it and solve it?

In the configuration of LiteCart. I've tried many types of UTF8 collations. Now using utf8_swedish_ci and my webhosting database is set to the same, so I don't get why it's not working.

Thank you!

timiTao
  • 1,417
  • 3
  • 20
  • 34
Owen Parsons
  • 71
  • 1
  • 2
  • 9
  • MyISAM or InnoDB? http://stackoverflow.com/questions/2344118/utf-8-general-bin-unicode – Matt May 16 '17 at 17:40
  • InnoDB but I'm not sure, where can I find this? – Owen Parsons May 16 '17 at 17:44
  • http://stackoverflow.com/questions/213543/how-can-i-check-mysql-engine-type-for-a-specific-table – Matt May 16 '17 at 17:45
  • If you're using `utf8_swedish_ci`, why are you using `utf8` in the code? – junkfoodjunkie May 16 '17 at 17:51
  • `SHOW CREATE TABLE ` - could you provide result of that? – timiTao May 16 '17 at 17:54
  • Which version of MySQL? Not every version supports every character set.. – George M Reinstate Monica May 16 '17 at 18:12
  • According to what I see in their codebase, I would not recommend using it with anything, that has to do with money: https://github.com/litecart/litecart/blob/dev/public_html/includes/functions/func_password.inc.php#L28 – tereško May 16 '17 at 20:27
  • @tereško I'm the author of LiteCart. What's wrong with password_hash()? – tim Apr 18 '20 at 02:13
  • @tim in 2017 that codebase had no mention of `password_hash()`. And it looks like you switched to it only in [13 Aug 2019](https://github.com/litecart/litecart/commit/f6e8c5416c81826bb9ba2e200c4c282c8af770a2) ... so ... this looks like somewhat disgusting attempt to spin a flaw that existed in 2017. – tereško Apr 21 '20 at 09:52

1 Answers1

1

Your quotes are messed up. Let's see the entire line to help you figure it out.

Either of these works:

SET NAMES utf8;
SET NAMES 'utf8';

but the real problem is in what happens just before that (which we cannot see all of).

Also, when performing queries from some clients, the ; should be left off. Again, let's see the source code.

utf8 (and utf8mb4) is a CHARACTER SET; that is what seems to be in question here. Anything else (such as utf8_unicode_520_ci) is a COLLATION.

Rick James
  • 135,179
  • 13
  • 127
  • 222