# How to enable MySQL/MariaDB 4-byte support

**URL:** <https://help.nextcloud.com/t/how-to-enable-mysql-mariadb-4-byte-support/42958>\
**Category:** 📦 Appliances (Docker, Snappy, VM, NCP, AIO)\
**Tags:** database, ncp\
**Created:** [December 11, 2018, 9:43am UTC](https://help.nextcloud.com/t/how-to-enable-mysql-mariadb-4-byte-support/42958 "2018-12-11T09:43:53Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![prog-amateur](https://help.nextcloud.com/letter_avatar/prog-amateur/32/6_22734026db12803ebb3e059622ac3534.png) [@prog-amateur](https://help.nextcloud.com/u/prog-amateur)\
**Post date:** [December 11, 2018, 9:43am UTC](https://help.nextcloud.com/t/how-to-enable-mysql-mariadb-4-byte-support/42958/1 "2018-12-11T09:43:54Z")

</div>

Hello, I use Nextcloudpi and I would like to sync my bookmarks with [floccus (for Firefox)](https://addons.mozilla.org/en-US/firefox/addon/floccus/).

I have a problem with the synchronization of my bookmarks with floccus (Error 500. Failed POST request) and I found a [subject about this error](https://github.com/marcelklehr/floccus/issues/210#) on the floccus github web page.

The solution proposed by the developer is that rich characters (like emoji) disturb the synchronization of bookmarks and it is then necessary to modify the MySQL or MariaDB database to modify the charset to utf8mb4 by following [this tutorial](https://docs.nextcloud.com/server/stable/admin_manual/configuration_database/mysql_4byte_support.html).

The reason I installed Nextcloudpi is that I’m not a code expert. I can try to tweak the system files but I’m afraid I’ll make mistakes. Could you tell me which database to modify (MySQL or MariaDB) and how to enable **utf8mb4** safely please ?

Thank you very much for your kind help.

---

<div class="post-metadata">

**Author:** ![DecaTec](https://help.nextcloud.com/user_avatar/help.nextcloud.com/decatec/32/76_2.png) [@DecaTec](https://help.nextcloud.com/u/DecaTec)\
**Post date:** [December 11, 2018, 10:11am UTC](https://help.nextcloud.com/t/how-to-enable-mysql-mariadb-4-byte-support/42958/2 "2018-12-11T10:11:27Z")

</div>

First of all: Create a backup before changing anything on the DB.

That done, start mysql from the command line (root account):  
`mysql -u root -p`

Select your NC DB (here I call it “nextcloud\_db”):  
`use nextcloud_db;`

The command `show variables like "character_set_database";` should output something like “latin1”, then no 4 byte support is enabled.

To change it: `ALTER DATABASE nextcloud_db CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;`

Another call of `show variables like "character_set_database";` should now ouput “utf8mb4”

Exit the mysql command line and make the changes to the NC config:

```auto
cd /var/www/nextcloud
sudo -u www-data php occ config:system:set mysql.utf8mb4 --type boolean --value="true"
sudo -u www-data php occ maintenance:repair

```

---

<div class="post-metadata">

**Author:** ![nachoparker](https://help.nextcloud.com/user_avatar/help.nextcloud.com/nachoparker/32/2975_2.png) [@nachoparker](https://help.nextcloud.com/u/nachoparker)\
**Post date:** [December 11, 2018, 12:39pm UTC](https://help.nextcloud.com/t/how-to-enable-mysql-mariadb-4-byte-support/42958/3 "2018-12-11T12:39:58Z")

</div>

NCP already has utfmb4 enabled, no need to change anything

I use floccus/firefox myself with NCP, no problems

---

<div class="post-metadata">

**Author:** ![DecaTec](https://help.nextcloud.com/user_avatar/help.nextcloud.com/decatec/32/76_2.png) [@DecaTec](https://help.nextcloud.com/u/DecaTec)\
**Post date:** [December 11, 2018, 2:11pm UTC](https://help.nextcloud.com/t/how-to-enable-mysql-mariadb-4-byte-support/42958/4 "2018-12-11T14:11:00Z")

</div>

OK, then we need the server logs I think.

---

<div class="post-metadata">

**Author:** ![prog-amateur](https://help.nextcloud.com/letter_avatar/prog-amateur/32/6_22734026db12803ebb3e059622ac3534.png) [@prog-amateur](https://help.nextcloud.com/u/prog-amateur)\
**Post date:** [December 12, 2018, 9:38am UTC](https://help.nextcloud.com/t/how-to-enable-mysql-mariadb-4-byte-support/42958/5 "2018-12-12T09:38:25Z")

</div>

Hello, thank you all for your help !

The log file is a bit complicated to share as it contains some private links (nothing abnormal don’t worry ^^) among many many others, so it is difficult to sort them before showing it.

What is strange, is that since Firefox 64.0 update this morning, I have no more issue (it shows `all good - Last synchronized : 3 mn ago`). I really don’t know what happened as it is the first time I install completely floccus. The only change was Firefox update (for your information, I am on Linux).

I keep this thread open a few days, and if there is no more issue, I will close it.

EDIT : I confirm that since the new Firefox version, I have no more trouble.

---

<div class="post-metadata">

**Author:** ![nextcloud\_jl](https://help.nextcloud.com/letter_avatar/nextcloud_jl/32/6_22734026db12803ebb3e059622ac3534.png) [@nextcloud\_jl](https://help.nextcloud.com/u/nextcloud_jl)\
**Post date:** [June 4, 2019, 4:07pm UTC](https://help.nextcloud.com/t/how-to-enable-mysql-mariadb-4-byte-support/42958/6 "2019-06-04T16:07:36Z")

</div>

I would need some help to reverse the process, because I found out, later in the game, that I can not have 4 byte support in my data base.

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 4, 2024, 8:29am UTC](https://help.nextcloud.com/t/how-to-enable-mysql-mariadb-4-byte-support/42958/7 "2024-12-04T08:29:57Z")

</div>



---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 9, 2024, 3:45pm UTC](https://help.nextcloud.com/t/how-to-enable-mysql-mariadb-4-byte-support/42958/8 "2024-12-09T15:45:01Z")

</div>


