Database does not support utf8mb4 charset

toplisek

Well-Known Member
Jan 7, 2010
218
15
68
I try to verify and convert.

If database does not support utf8mb4 charset and database tables have not been converted yet which Linux command to execute without breaking the structure?

Code:
./console core:convert-to-utf8mb4
Is this safe and the correct code inside root account as it reports an error:
./console: No such file or directory

and
Code:
$ console core:convert-to-utf8mb4
and error:
command not found
 
Last edited:

andrew.n

Well-Known Member
Jun 9, 2020
581
158
43
EU
cPanel Access Level
Root Administrator
The easiest way is to convert the tables from PHPMyAdmin but make sure you backup the database beforehand so you can revert if there is any issues.
 

toplisek

Well-Known Member
Jan 7, 2010
218
15
68
1. You mean the following command?
Code:
ALTER DATABASE database_name CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;
2. How to make it using Linux command?
Code:
$ console core:convert-to-utf8mb4
 

andrew.n

Well-Known Member
Jun 9, 2020
581
158
43
EU
cPanel Access Level
Root Administrator
You can also use the mysql prompt. If you logged in as root via SSH type "mysql" then hit enter and you will be at the prompt.
 

cPJustinD

Administrator
Staff member
Jan 12, 2021
183
34
103
Houston
cPanel Access Level
Root Administrator
Hello, toplisek! You can change the character sets using the methods andrew.n mentioned. However, we recommend making a backup of your databases before making any changes in case they need to be reverted. We would also advise working with your Database Administrator to implement these changes to ensure the changes are applied properly.

Please note that cPanel, LLC only supports the cPanel-provided software and does not provide general system-administration services. You may, therefore, wish to seek assistance from a qualified system administrator for this issue.

If you do not have such an administrator, you may search for one in our listings here:

System Administration Services

Please note, however, that cPanel, LLC does not endorse or recommend any particular provider on that list, nor can we be held liable for any services performed by third-party providers, including those on the list.

We've also provided an article on changing the default character set for MariaDB and MySQL that may offer further guidance:

How Do I Change The Default Character Set in MySQL/MariaDB to utf8?

I hope that this information helps. If you have any additional questions or concerns, please let us know!
 

toplisek

Well-Known Member
Jan 7, 2010
218
15
68
If I type mysql inside root, can be also modified only one username account not all MYSQL service for all accounts?
 

cPJustinD

Administrator
Staff member
Jan 12, 2021
183
34
103
Houston
cPanel Access Level
Root Administrator
Hello again toplisek! When logged into MySQL as root, you can still alter the character set and collation per database; however, it appears that it may also need to be enabled globally in MySQL. I found the following information online; however, that may help:

https://community.denodo.com/kb/en/view/document/Configuring MySQL for full Unicode support
https://dba.stackexchange.com/quest...y-convert-utf8-tables-to-utf8mb4-in-mysql-5-5

Please keep in mind that the information I've provided above are from community forums, so there may be some information that does not apply specifically to your version of MySQL. If the information above does not help, it may be worth reaching out to your database or server administrator for further assistance.
 

toplisek

Well-Known Member
Jan 7, 2010
218
15
68
I have run:
ALTER DATABASE DBNAMEXXX CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci

Report is the following:
MySQL returned an empty result set (i.e. zero rows). (Query took 0.0003 seconds.)
Does it mean it actually supports utf8mb4 COLLATE = utf8mb4_unicode_ci?