coreshop / CoreShop

CoreShop - Pimcore enhanced eCommerce
http://www.coreshop.org
Other
275 stars 157 forks source link

Installation with utf8mb4 #135

Closed Yivan closed 7 years ago

Yivan commented 7 years ago

Hello,

I get an error installing CoreShop with utf8mb4 database type, when (activate the plugin in Pimcore -> Extensions) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'test_coreshop.coreshop_states' doesn't exist Behind the scene some SQL error prevent CoreShop sql to run because of the utf8mb4.

I don't know if it is intended or not, but maybe a check should be done and print a message saying utf8mb4 is not suported or force the creation of the table on a specific compatible collaction on the .sql files.

Thanks.

dpfaffenbauer commented 7 years ago

ut8mb4 is intendend, but I don't unterstand why it can't create the table? do you have some more information regarding this issue?

Yivan commented 7 years ago

To make it easy i created a fresh database utf8mb4_unicode_ci, and import the file /install/sql/CoreShop.sql (using phpMyAdmin) and i get the following error:

SQL Request:

ALTER TABLE coreshop_numberranges ADD UNIQUE (
`type` ,
`shopId`
);

#1071 - Specified key was too long; max key length is 767 bytes 

I think because the length of the composed key is too long in mb4 for the index. If i create the database utf8_unicode_ci, i got no error.

dpfaffenbauer commented 7 years ago

thanks for the information, I made some changes, can you try it again?

Yivan commented 7 years ago

I confirm this this error is no more triggered, great. But another now (always by importing the new CosreShop.sql in phpMyAdmin):

SQL request:

DELETE FROM  `users_permission_definitions` WHERE  `key` LIKE  'coreshop_permission%';

#1146 - Table 'testcs.users_permission_definitions' doesn't exist 
dpfaffenbauer commented 7 years ago

have you installed pimcore in this database?

users_permission_definitions is the pimcore definitions database.

Yivan commented 7 years ago

Hum i am silly, this is because there is no pimcore (just fresh empty database!). So I think all is ok now. Thanks a lot for your fast action.

dpfaffenbauer commented 7 years ago

:)

Galch24 commented 3 years ago

I had the same problem on mac os. In my pimcore project we have our unique docker-compose.yml config. So I resolve that by adding this lines on database (mysql) section inside docker-compose.yml:

db:
    ...
    command: [mysqld, --character-set-server=utf8mb4, --collation-server=utf8mb4_unicode_ci, --innodb-file-format=Barracuda, --innodb-large-prefix=1, --innodb-file-per-table=1]
    ...