My database is using utf8mb4 at many places except the character_set_server and collation_server.
Is this something I can fix myself or do I have to ask my provider support?
… and if yes: how?
I do not have access to MySQL configuration file (/etc/my.cnf):
The important part is the collation that is used for the database table modx_site_content. And to be more specific: For the column content of that table.
It’s possible to change the character set with SQL or for example with phpMyAdmin.
I don’t know if it is a good idea to change the charset of a table that already contains data. Possibly the data in the table is wrong after the change.
Alternatively, you could also try to change the TinyMCE configuration, so that ř doesn’t get replaced at all.
I believe the settings entities and entity_encoding are used for this:
The TinyMCE RTE extra has the system settings tinymcerte.external_config and tinymcerte.settings to change the default settings.
Or if nothing else works, you could write a custom MODX plugin, that runs on the event “OnBeforeDocFormSave” and replaces ř with ř again in the content.
I have installed php on my PC (ver. 7.4.33)
Your script, cdc.config.php and the saved database are in the same directory
I’m getting the following error message:
PS E:\Christoph\MicsWeb\cdc> php .\cdc.php
Warning: “continue” targeting switch is equivalent to “break”. Did you mean to use “continue 2”? in E:\Christoph\MicsWeb\cdc\cdc.php on line 418
Fatal error: Uncaught Error: Call to undefined function mysqli_connect() in E:\Christoph\MicsWeb\cdc\cdc.php:194
Stack trace: #0 {main}
thrown in E:\Christoph\MicsWeb\cdc\cdc.php on line 194
That suggests that the MySQLi (MySQL Improved) extension is not enabled in your PHP configuration. If you enable it in php.ini, then, restart your web server, it should eliminate that error. The warning above that can be ignored.
I installed xampp, created database and imported backup
I’m sure credentials are properly copied to the config file.
Nevertheless my computer is blocking access to database.
Fatal error: Uncaught mysqli_sql_exception: Access denied for user ‘micsvm_1’@‘localhost’ (using password: YES) in C:\xampp\htdocs\cdc\cdc.php:194 Stack trace: #0 C:\xampp\htdocs\cdc\cdc.php(194): mysqli_connect(‘localhost’, ‘micsvm_1’, Object(SensitiveParameterValue), ‘micsvm_db1’) #1 {main} thrown in C:\xampp\htdocs\cdc\cdc.php on line 194
Interesting. I wonder if that CONVERT TO CHARACTER SET command existed when I wrote the script. I would have saved me a ton of work and probably run faster. The script was written a very long time ago – 2010 or maybe even earlier.