1.6rc Convert to utf8mb4

1.6rc tries to change table character set to uft8mb4. The statement gives an error with mysql database.

USER ERROR: mysqli Error: ( ALTER TABLE .administrators CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci ) failed. mysqli returned the error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.administrators CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci' at line 1 in /var/www/html/ZenPhoto/zp-core/classes/class-dbmysqli.php on line 80

trigger_error called from dbMySQLi->query (class-dbmysqli.php [80])

from dbBase->convertTableToUtf8mb4 (class-dbbase.php [907])

from index.php [2440]
The database name needs to be quoted.
ALTER TABLE .administrators CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4

Updating the character set and collation for the tables using mysql-client allowed setup to skip this step and complete


  • I meant the table name has to be quoted.

  • acrylian Administrator, Developer
    edited November 2022

    No, actually ist must not and these parts have not been change for ages. It is prefixed and setup with backticks (which are not really needed unless you use a reservered word "show" column in some tables) in these queries

    I am pretty sure the issue that interesting dot before your table name. Otherwise we and others helping would have seen this error before.

    That looks as if you have not set a proper database prefix. Is that a fresh install or an update?

  • It is an update. There has never been a problem until the code to change the character set was added. backticks are needed because of the dot at the start of the table names in my database. They are missing in the sql for the ALTER TABLE generated by Zenphoto when the command is displayed as part of the error message in the debug log. Adding backticks to that command and then executing it with the mysql client works. It seems that the problem of no backticks is limited to this particular sql command otherwise there would be other failures.

  • acrylian Administrator, Developer

    Yes, sorry, you are indeed right. In that specific queriy the backticks were indeed missing. Fixed now. Thanks.

  • Thank you for your prompt response

Sign In or Register to comment.