jan-vandenberg / cruddiy

No-code Bootstrap PHP CRUD generator
http://cruddiy.com
GNU Affero General Public License v3.0
250 stars 80 forks source link

Error 500 when submitting database info #131

Closed lcsqlpete closed 6 months ago

lcsqlpete commented 6 months ago

Right after submitting the database info during setup, I get an error 500 message from my server. Looking at the logs, I see that this was caused by "PHP Fatal error: Uncaught mysqli_sql_exception: Invalid character set was provided" on line 41 of the config.php file in the cruddiy-master/code/myapp/config.ini

germain-italic commented 6 months ago

Hi, there's no config.ini file in Cruddiy. This looks like a local configuration problem. What's in that file?

lcsqlpete commented 6 months ago

It should read:

"PHP Fatal error: Uncaught mysqli_sql_exception: Invalid character set was provided" on line 41 in the cruddiy-master/core/myapp/config.php file.

The Mysql version is 8.0.28-0ubuntu0.20.04.3 as returned by SELECT Version()

I've attached the zipped config.php.zip file for reference.

germain-italic commented 6 months ago

@lcsqlpete your database uses the utf8mb3 charset which is deprecated and has been removed from specific distributed packages.

You must use utf8mb4 to correctly support Unicode characters.

That being said, I've published a patch that will fallback the generator's connexion to utf8mb4 if an unrecognized charset is detected.

The current charset for the connection is now displayed after config submission:

This patch is in the master branch and hasn't been released yet, so download the ZIP file from the project homepage instead of the Releases page.

Also, change your MySQL server password immediately!

lcsqlpete commented 6 months ago

Thanks, that fixed the problem. Also noted the db password change.