7 – SQL error updating utf8mb4

I have successfully followed the instructions on the Drupal page to update uft8mb4 except for 1 table that shows the following error:

https://www.drupal.org/node/2754539

Error
SQL query:


ALTER TABLE `file_managed` CONVERT TO CHARACTER SET utf8mb4 COLLATE 
utf8mb4_general_ci
MySQL said: Documentation

#1062 - Duplicate entry 'public://listings/4232.jpg' for key 'uri'

What should I do to complete the update?

The character set & # 39; utf8mb4 & # 39; it is not a compiled character set and is not specified in the file & # 39; /usr/share/mysql/charsets/Index.xml'

Complete error

The character set & # 39; utf8mb4 & # 39; it is not a compiled character set and is not specified in the file & # 39; /usr/share/mysql/charsets/Index.xml'
InvalidArgumentException: There was a problem connecting to the database: SQLSTATE[HY000] [2019]    Unable to initialize the utf8mb4 character set (path: / usr / share / mysql / charsets /)

mysql See 14.14 Distrib 5.7.26

I'm trying to fix this error, but I can not fix it on an active server. I had to go through the procedure of adding the following to the /usr/share/mysql/charsets/Index.xml file in a local virtual machine that worked.


  Unicode
  UTF-8 MB4 Unicode
  
    primary
    compiled
  
  
    binary
    compiled
  

I have restarted mysql a couple of times since I updated this in vain. My database connection is shown as such

<? php
$ db = new PDO ("mysql: host = $ host; dbname = $ db; charset = utf8mb4", $ db_username, $ db_pass);

And all the variables in my database seem to be verified based on other publications I've seen

enter the description of the image hereenter the description of the image here

my.cnf has the following set also

set of characters-server = utf8mb4
collation-server = utf8mb4_unicode_ci