Skip to content
  • Solutions
    By Role
    • For Developers
    • For Content Managers
    • For Agencies
    • For IT Admins
    • For Web Hosters
    • For Developers
    • For Content Managers
    • For Agencies
    • For IT Admins
    • For Web Hosters
    By Infrastructure
    • Overview
    • AWS
    • Microsoft Azure
    • Alibaba Cloud
    • Google Cloud Platform
    • Vultr
    • Overview
    • AWS
    • Microsoft Azure
    • Alibaba Cloud
    • Google Cloud Platform
    • Vultr
    • Digital Ocean
    • Linode
    • Upcloud
    • Oracle
    • OVH
    • Digital Ocean
    • Linode
    • Upcloud
    • Oracle
    • OVH
  • Product
    • Plesk Features
    • Plesk Editions
    • What’s new
    • Pricing
    • Roadmap
    • Lifecycle Policy
    • Extensions Catalogue
  • Pricing
  • Extensions
    Featured Extensions
    • SocialBee
    • WP Toolkit
    • Sitejet Builder for Plesk
    • SEO Toolkit
    • Joomla! Toolkit
    • Premium Email
    • Email Security
    • SocialBee
    • WP Toolkit
    • Sitejet Builder for Plesk
    • SEO Toolkit
    • Joomla! Toolkit
    • Premium Email
    • Email Security
    Bundles and packs:
    • Business and Collaboration Edition
    • WP pack
    • Hosting pack
    • Power pack
    • Language pack
    • Business and Collaboration Edition
    • WP pack
    • Hosting pack
    • Power pack
    • Language pack

    See all Extensions

  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
  • Pricing
  • Solutions
    • By Role
      • For Developers
      • For Content Managers
      • For Agencies
      • For IT Admins
      • For Web Hosters
    • By Infrastructure
      • Overview
      • Plesk on Amazon Web Services (AWS & Lightsail)
      • Microsoft Azure
      • Alibaba Cloud
      • Google Cloud Platform
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
      • Oracle
      • OVH
  • Products
  • Pricing
  • Extensions
    • Featured Extensions
      • SocialBee
      • WP Toolkit
      • Sitejet Builder for Plesk
      • SEO Toolkit
      • Joomla! Toolkit
      • Premium Email
      • Email Security
    • Bundles and packs:
      • Business and Collaboration Edition
      • WP pack
      • Hosting pack
      • Power pack
      • Language pack
      • See all Extensions
  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate Program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
  • Pricing
  • Solutions
    • By Role
      • For Developers
      • For Content Managers
      • For Agencies
      • For IT Admins
      • For Web Hosters
    • By Infrastructure
      • Overview
      • Plesk on Amazon Web Services (AWS & Lightsail)
      • Microsoft Azure
      • Alibaba Cloud
      • Google Cloud Platform
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
      • Oracle
      • OVH
  • Products
  • Pricing
  • Extensions
    • Featured Extensions
      • SocialBee
      • WP Toolkit
      • Sitejet Builder for Plesk
      • SEO Toolkit
      • Joomla! Toolkit
      • Premium Email
      • Email Security
    • Bundles and packs:
      • Business and Collaboration Edition
      • WP pack
      • Hosting pack
      • Power pack
      • Language pack
      • See all Extensions
  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate Program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
Plesk 360 login
Free Trial

Knowledge Base

How to change the MySQL/MariaDB default charset from “utf8_unicode_ci” to “utf8mb4_unicode_ci” in MySQL in Plesk for Linux?

 
databasedatabase serverdatabasesgolinux

Question

How to change the MySQL/MariaDB default charset from "utf8_unicode_ci" to "utf8mb4_unicode_ci" in MySQL in Plesk for Linux?

Answer

This feature is not yet implemented in Plesk.

If you would like to see this feature in Plesk, please vote for it on Plesk UserVoice:

  • Allow to chose another charset when creating a database or do not set one

By default, Plesk databases are created with the following command:

CREATE DATABASE
databasename
/*!40101 default charset=utf8 */

As a workaround, apply the following solution:

Create an event which will change the charset upon creation of a new database
  1. Connect to a Plesk server via SSH.

  2. Create the file /root/dbscript.sh with the following content:

    #!/bin/sh

    db=${NEW_DATABASE_NAME}

    plesk db "ALTER DATABASE $db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci"

  3. Set the correct permissions:

    # chmod 0775 /root/dbscript.sh

  4. In Plesk, go to Tools & Settings > Event Manager and click Add Event Handler.
  5. Choose the event type to be Database created, put the following in the command section and press OK:

    /root/dbscript.sh

    2018-12-19_17_47_01-Adding_Event_Handler_-_Plesk_Onyx_17.8.11.png

Additionally, you could also set the UTF8mb4 charset directly within the configuration file of your database server by using the information below:

Change the charset directly in MySQL/MariaDB configuration (via SSH)

Warning: These changes affect in database creation that is done directly in MySQL/MariaDB and is not done via Plesk interaction.

  1. Log into the server via SSH.

  2. Open the /etc/my.cnf file with the vi text editor and add the following lines under the corresponding sections:

    Note: for example if the default-character-set line already specified replace its value with utf8mb4.

    [client]
    default-character-set = utf8mb4
    [mysql]
    default-character-set = utf8mb4
    [mysqld]
    character-set-server = utf8mb4
    collation-server = utf8mb4_unicode_ci

  3. Restart the MariaDB service to apply the changes:

    # systemctl restart mariadb

Additional information

Best way to make sure a MySQL database is fully in UTF8 - Server Fault

sql - How to convert a big MySQL Database from utf8 to utf8mb4? - Stack Overflow

mysql - Trouble with UTF-8 characters; what I see is not what I stored - Stack Overflow

Tweet
Share
Share
Email
0 Shares
Read the full article
Related Posts

How to Check Open Ports in Linux (Simple Commands & Tools)

Read More »

Linux Logs Explained

Read More »

How to Host a Go App on Plesk

Read More »
Knowledge Base

Unable to add MySQL/MariaDB/MSSQL database in Plesk: the option is missing

Read More »

How to enable remote access to MySQL/MariaDB server in Plesk?

Read More »

Plesk or system update fails on Linux: http://yum.mariadb.org/10.1/centos7-amd64/repodata/repomd.xml: [Errno 14] HTTP Error 404 – Not Found

Read More »

Cannot start MariaDB on Plesk server: the directory /var/lib/mysql is not empty, so initialization cannot be done

Read More »

Hosting Wiki

  • Django
  • RESTful Web Service
  • Server Redundancy
  • Cloud Service Architecture
  • Virtualizor
  • On-Demand Services
  • Linux Containers
  • Google Cloud CDN
  • Bare Metal Server
  • Denial of Service
  • MySQL
  • Red Hat Virtualization
  • Virtuozzo
  • Oracle VM Server
  • Citrix Hypervisor
  • Server Virtualization Software
  • Windows Server
  • Linux
  • Virtualization
  • MongoDB
  • SQL
  • VirtualMin
  • Plesk
  • SQL database
  • NoSQL Database
  • Web Server
  • DNS Server
  • SSH
  • Email Virus Protection
X-twitter Linkedin Youtube Reddit Github
  • Product
  • Login
  • Pricing
  • Editions
  • For Partners
  • Partner Program
  • Contributor Program
  • Affiliate Program
  • Plesk University
  • Company
  • Blog
  • Careers
  • Events
  • About Plesk
  • Our Brand
  • Resources
  • User and Admin guides
  • Help Center
  • Migrate to Plesk
  • Contact Us
  • Hosting Wiki
  • Forum
  • Legal
  • Legal
  • Privacy Policy
  • Imprint

© 2025 WebPros International GmbH

Part of the WebPros®  Family