I'm running through the tutorial for TinyMVC on a Linux machine.
Everything was working fine until I got to the models page:
As soon as I did the "Learn by Example" step, I got this error:
Error: 0
Message: Can't connect to PDO database 'mysql'. Error: SQLSTATE[HY000] [2019] Can't initialize character set UTF-8 (path: /usr/share/mysql/charsets/)
File: /data/utilities/tinymvc/sysfiles/plugins/tinymvc_pdo.php
Line: 107
I'm using PHP5 and PDO is installed and compiled (TinyMVC throws an error if it is not). If I change the charset to something else (like UTF8 or latin1), it gets around this error, but then there is another error in the sysfiles that I'm not supposed to have to edit to get TinyMVC working. There is no UTF-8.xml file in /usr/share/mysql/charsets/
, but something I read suggested that there shouldn't be.
Any thoughts on what the problem is?
Since the default character set on most MySQL databases is latin1, I tried adding the following line to the database configuration file tinymvc/configs/database.php
$config['default']['charset'] = 'utf8'; // changed from UTF-8
This seems to have fixed the problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With