3

According to the DevDocs only MySQL 5.6 and 5.7 is supported. I have set up a shop now with MySQL 8.0 and it seems to work so far. However, it is not a fresh installation, instead I dumped the database from MySQL 5.7 server and imported it into MySQL 8.0, then switched the database connection in the app/etc/env.php configuration.

Could I run into any issues by using this version? Is there anything that will not work?

2 Answers 2

2

Magento 2 (latest version 2.3.4 at time of writing) still isn't officially compatible with MySQL 8, but at least you can install it from scratch.

From the Magento 2.3.4 release notes:

You can successfully install Magento 2.3.4 with MySQL 8. Previously, installation stopped because the patch triggered forced indexation. However, Magento 2.3.4 is not yet fully compatible with MySQL 8, so use at your own risk. Full support for MySQL 8 is scheduled for Magento 2.4.0. Fix submitted by Anton Kaplya in pull request 25357. GitHub-25294

With Magento 2.3.3 I've noticed that creating store views will break the database due to some index table issues. So if you're not running a multi-store site, you will probably be fine (I haven't noticed any other issues).

Also this post suggests to run:

mysql> CREATE USER magento2 IDENTIFIED 
   WITH 'mysql_native_password' BY 'magento2';
mysql> GRANT ALL ON magento2.* TO magento2;
mysql> SET PERSIST log_bin_trust_function_creators=1;

Otherwise you could get this error during bin/magento setup:install:

SQLSTATE[HY000]: General error: 1419 You do not have the SUPER privilege and binary logging is enabled (you might want to use the less safe log _bin_trust_function_creators variable), query was: CREATE TRIGGER trg_catalog_product_entity_after_insert AFTER INSERT ON catalog_product_entity
FOR EACH ROW
BEGIN
INSERT IGNORE INTO `scconnector_google_feed_cl` (`entity_id`) VALUES (NEW.`entity_id`);
END

3
  • 1
    Thanks. I just ran into this issue today. log_bin_trust_function_creators was not set. I've enriched your answer. Hope that is okay for you. Perth... lived there for half a year, 20 years ago. Nice there!
    – robsch
    Feb 6, 2020 at 7:43
  • Thanks @robsch — Perth is indeed wonderful!
    – Erfan
    Feb 7, 2020 at 2:08
  • Tame Impala!!! :-D
    – robsch
    Feb 7, 2020 at 8:56
1

As @Erfan said Magento latest 2.3.4 isn't officially compatible with MySQL 8. Although I can confirm that in our setup we have already upgraded to MySQL 8 from the first day of 2.3.4 released.

We don't have any errors in logs of magento or mysql logs. Our setup was always using Percona server.

So we went again with this. We didn't installed magento 2.3.4 from scratch.

We just upgraded to 2.3.4 then we dumped the database from Percona 5.7 After we upgraded to Percona 8.0.18-9. At last we imported the database to new Percona.

Before importing the database to Percona 8 we used some things of this Blog(@Erfan also mentioned it)

mysql> SET persist enforce_gtid_consistency=on;
 
mysql> SET persist_only gtid_mode=on;

This is just for future replication

mysql> SET PERSIST log_bin_trust_function_creators=1;

And this because sometimes magento database user need more privileges

Also you need to enable

mysql_native_password authentication

Conclusion:

Magento seems stable. Everything is working in admin and frontend without errors anywhere.

We also see some improvement in Magento's DB actions. It seems faster than Percona 5.7

6
  • Have you tried creating new websites/store view scopes?
    – Erfan
    Feb 7, 2020 at 2:08
  • @Erfan I haven't tried to create new websites or store. I have already two different store views in this Magento. Why you ask this? Is this creates problem?
    – G. G.
    Feb 7, 2020 at 10:10
  • Yeah I think it creates a problem with MySQL 8. But not sure. Anyway, I'll have to test this next week. I'll report back :)
    – Erfan
    Feb 8, 2020 at 9:09
  • 1
    Confirmed that persona 8 works without errors in magento 2.3.4 All tests are good....New stores, stores views and everything work fine.
    – G. G.
    Feb 18, 2020 at 18:07
  • I'm still finding that creating new store views fails with MySQL 8 on Magento 2.3.4.
    – Erfan
    Feb 19, 2020 at 11:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.