laravel7-larashop icon indicating copy to clipboard operation
laravel7-larashop copied to clipboard

Error on startup

Open hendisantika opened this issue 4 years ago • 6 comments

After running db:seed, I have this Error on startup:

image

Any suggestions? Thanks

hendisantika avatar Mar 01 '21 08:03 hendisantika

Hi Mas @hendisantika , I believe it's related to the sqlmode on your MySQL server. Could you please show me the sqlmode on your dbserver so that I can reproduce the issue? I've tested this code on mysql version 5.7 and 8.x with the following sqlmode (demo url: http://108.61.222.138/course-larashop7/ )

Screen Shot 2021-03-02 at 06 37 44

Some people face that issue but I haven't reproduced it yet in my local. Thanks.

gieart87 avatar Mar 01 '21 23:03 gieart87

Here's the result:

image

Is there something need to change?

hendisantika avatar Mar 01 '21 23:03 hendisantika

It can be fixed by either updating the sql query or updating the sqlmode. But, I prefer to fix it by updating the query. Your sql_mode is a bit different from the default https://dev.mysql.com/doc/refman/8.0/en/sql-mode.html . Adding the ONLY_FULL_GROUP_BY on the sqlmode may fix the issue if I'm not mistaken. Let me reproduce it first on my local.

gieart87 avatar Mar 01 '21 23:03 gieart87

still could not replicate the issue :))

gieart87 avatar Mar 02 '21 00:03 gieart87

Could You tell me How to add ONLY_FULL_GROUP_BY?

hendisantika avatar Mar 02 '21 00:03 hendisantika

Find your my.cnf file then add the sqlmode you want, e.g: Screen Shot 2021-03-02 at 09 03 58

https://stackoverflow.com/questions/23921117/disable-only-full-group-by

gieart87 avatar Mar 02 '21 02:03 gieart87