Concrete 5.6 and MySQL8 [solved]

My web hosting company is forcing me to move to a new server and my Concrete 5.6 sites were breaking on the new server running MySQL8. It seems a few other users are in the same position. Fortunately, my hosting company found an elegant solution (big thanks to A2 Hosting!) to make the migration smoother. I wanted to share it here. It involves changing all the SQL statements that include the reserved word “groups” by wrapping them in ticks. All you need access to is SSH on your server. If you can’t do this yourself, then just send a ticket to your hosting company and link to this post and they will understand what to change for you.

Firstly, it will find a list of files that contain the db variable and word “groups”:

[SERVERNAME public_html]$ grep -Rl “$db.*Groups” .
./updates/concrete5.6.3.1/concrete/helpers/concrete/upgrade/version_560.php
./updates/concrete5.6.3.1/concrete/core/models/userinfo.php
./updates/concrete5.6.3.1/concrete/core/models/search/group.php
./updates/concrete5.6.3.1/concrete/core/models/permission/keys/custom/access_user_search.php
./updates/concrete5.6.3.1/concrete/core/models/permission/access/entity/types/group.php
./updates/concrete5.6.3.1/concrete/core/models/permission/access/entity/types/group_combination.php
./updates/concrete5.6.3.1/concrete/core/models/permission/access/entity/types/group_set.php
./updates/concrete5.6.3.1/concrete/core/models/group_set.php
./updates/concrete5.6.3.1/concrete/core/models/user.php
./updates/concrete5.6.3.1/concrete/core/models/groups.php
./updates/concrete5.6.3.2/concrete/helpers/concrete/upgrade/version_560.php
./updates/concrete5.6.3.2/concrete/core/models/userinfo.php
./updates/concrete5.6.3.2/concrete/core/models/search/group.php
./updates/concrete5.6.3.2/concrete/core/models/permission/keys/custom/access_user_search.php
./updates/concrete5.6.3.2/concrete/core/models/permission/access/entity/types/group.php
./updates/concrete5.6.3.2/concrete/core/models/permission/access/entity/types/group_combination.php
./updates/concrete5.6.3.2/concrete/core/models/permission/access/entity/types/group_set.php
./updates/concrete5.6.3.2/concrete/core/models/group_set.php
./updates/concrete5.6.3.2/concrete/core/models/user.php
./updates/concrete5.6.3.2/concrete/core/models/groups.php
./updates/concrete5.6.3.1b/concrete/helpers/concrete/upgrade/version_560.php
./updates/concrete5.6.3.1b/concrete/core/models/userinfo.php
./updates/concrete5.6.3.1b/concrete/core/models/search/group.php
./updates/concrete5.6.3.1b/concrete/core/models/permission/keys/custom/access_user_search.php
./updates/concrete5.6.3.1b/concrete/core/models/permission/access/entity/types/group.php
./updates/concrete5.6.3.1b/concrete/core/models/permission/access/entity/types/group_combination.php
./updates/concrete5.6.3.1b/concrete/core/models/permission/access/entity/types/group_set.php
./updates/concrete5.6.3.1b/concrete/core/models/group_set.php
./updates/concrete5.6.3.1b/concrete/core/models/user.php
./updates/concrete5.6.3.1b/concrete/core/models/groups.php
./updates/concrete5.6.3.5_remote_updater/concrete/helpers/concrete/upgrade/version_560.php
./updates/concrete5.6.3.5_remote_updater/concrete/core/models/userinfo.php
./updates/concrete5.6.3.5_remote_updater/concrete/core/models/search/group.php
./updates/concrete5.6.3.5_remote_updater/concrete/core/models/permission/keys/custom/access_user_search.php
./updates/concrete5.6.3.5_remote_updater/concrete/core/models/permission/access/entity/types/group.php
./updates/concrete5.6.3.5_remote_updater/concrete/core/models/permission/access/entity/types/group_combination.php
./updates/concrete5.6.3.5_remote_updater/concrete/core/models/permission/access/entity/types/group_set.php
./updates/concrete5.6.3.5_remote_updater/concrete/core/models/group_set.php
./updates/concrete5.6.3.5_remote_updater/concrete/core/models/user.php
./updates/concrete5.6.3.5_remote_updater/concrete/core/models/groups.php
./updates/concrete5.6.4.0/concrete/helpers/concrete/upgrade/version_560.php
./updates/concrete5.6.4.0/concrete/core/models/userinfo.php
./updates/concrete5.6.4.0/concrete/core/models/search/group.php
./updates/concrete5.6.4.0/concrete/core/models/permission/keys/custom/access_user_search.php
./updates/concrete5.6.4.0/concrete/core/models/permission/access/entity/types/group.php
./updates/concrete5.6.4.0/concrete/core/models/permission/access/entity/types/group_combination.php
./updates/concrete5.6.4.0/concrete/core/models/permission/access/entity/types/group_set.php
./updates/concrete5.6.4.0/concrete/core/models/group_set.php
./updates/concrete5.6.4.0/concrete/core/models/user.php
./updates/concrete5.6.4.0/concrete/core/models/groups.php
./concrete/models/userinfo.php
./concrete/models/search/group.php
./concrete/models/page.php
./concrete/models/user.php
./concrete/models/area.php
./concrete/models/task_permission.php
./concrete/models/groups.php

And then run this grep command:

[SERVERNAME public_html]$ grep -Rl “$db.*Groups” . | xargs -d ‘\n’ -I {} sed -i “s/\bGroups\b/`Groups`/g” {}

That’s it!

As always, it’s best to make a backup copy of the site files and MySQL database before doing any substantial change like this.

Hope this helps!

If you grab the latest version of 5.6.4.0 from GitHub it has fixes for MySQL 8 already done - GitHub - concretecms/concrete5-legacy: Legacy repository for concrete5

Ah, good to know! I had some customisations done on my install, so the update would have overwritten those.