Attempting to install beta8 using composer create-project flarum/flarum . --stability=beta
No issues installing beta 7 prior, but having issues with beta 8. Likely due to 10.2.19-MariaDB
Any tips/ideas/solutions?

VPS
Apache 2.4.37
PHP 7.2.12
MySQL 10.2.19-MariaDB

Error during Flarum install:

Something went wrong: SQLSTATE[HY000]: General error: 1005 Can't create table stest_flarum.#sql-22fa_2236 (errno: 150 "Foreign key constraint is incorrectly formed") (SQL: alter table posts add constraint posts_user_id_foreign foreign key (user_id) references users (id) on delete set null)

Running SHOW ENGINE INNODB STATUS
LATEST FOREIGN KEY ERROR

2018-11-28 21:33:26 0x7f5ad4b98700 Error in foreign key constraint of table stest_flarum.posts:
Alter table stest_flarum.posts with foreign key constraint failed. Referenced table stest_flarum.users not found in the data dictionary near ' foreign key (user_id) references users (id) on delete set null'.


Resolved: Check mysql default engine. If MyISAM, change default to innodb.
Default engine was MyISAM, Changed my.cnf --> default-storage-engine=innodb

  • Toby replied to this.

    same here:
    PHP 7.2
    MySQL 5.7+
    Database is utf8mb4_unicode_ci

    • Toby replied to this.

      naj ralphskie Can you please check the following things for me:

      • Table engine of posts and users (InnoDB?)
      • Column types of posts.user_id and users.id

        Toby
        posts = innodb
        users = myisam

        posts.user_id = int
        users.id = int

        • Toby replied to this.

          Toby
          set default engine was MyISAM, I commented it so it will use the default engine on MySQL version 5.7+ which is INNODB.
          test install again, and it works fine.

          so I guess INNODB must be the Database engine before installing 👍

            It is probably worth fixing the errors associated with the version of PHP 7.2 people sometimes do not read the installation document completely

            Or make a version check before installing

              Pirat beta 8 works perfectly fine on php 7.2: I'd even recommend it over any previous versions.

              ralphskie Thanks! Fixed the issue.

              set default engine was MyISAM, I commented it so it will use the default engine on MySQL version 5.7+ which is INNODB.
              test install again, and it works fine.

              I confirm, InnoDB have to be set as default engine, because MyISAM don't work.

              i having the same problem.

              and I did not backup db 😢

              • Toby replied to this.

                HalilEsen You'll need to manually change the tables in your database to use the InnoDB engine. Backup your database before you do this. Always backup your database before upgrading Flarum, especially while it's still in beta.

                  Toby thank you.

                  only users table engine problem. 😅 now work forum and backup database

                  Toby Just did that and it fixed the error. I managed to update to Beta 8, but getting a core.views.content.load_error_message on the homepage now, together with a header. Everything else is blank.

                    Chris89 please start a new discussion so we can separate the issues for lurkers.

                    Having the same problem, I am trying to set up my Flarum install on a shared web hosting service, and I am not sure if I have the leverage to edit the mysql settings to use InnoDB as the default. Is there a work around to this? If not, can I possibly use the older version instead (beta7 -- assuming I won't run into this issue)?

                    My provider has the following settings:

                    default storage engine=  MyISAM
                    default tmp storage engine=  InnoDB

                      neoblizz You will need to use InnoDB in order for the migrations to run and for you to update to beta 8.

                      I am not migrating from anything though, it is a new install entirely. Would I still need InnoDB for that?

                        neoblizz Yes, Innodb is required for beta 8, regardless or whether you are updating or installing anew.