Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Better error message for MySQL 8 workaround #21339
Summary of Changes
Joomla 4.0 don't work with MySQL 8 without a workaround.
Please follow these introductions from this wiki I wrote to make Joomla 4.0 and MySQL 8 working.
I add a link to the error message to help some users who wants to use Joomla with MySQL 8.
Please open your configuration file sudo nano /etc/my.cnf (Please note that your file may be under a different directory) and add the following configuration:
If you don't have access to your config file then you can update your user as follows:
ALTER USER 'username'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
Replace username with the name of the user account and password with the password belonging to the account. Restart MySQL and you are done, well only if you have Joomla 3.8 or 3.9 installed.
If you want to work with Joomla 4.0 you have to do some extra work, because the administration dashboard is blank after the installation with Joomla 4.0 and MySQL 8.
The following query must be run to fix this. Replace #_ with your table prefix.
UPDATE `#__modules` SET `checked_out_time` = '1000-01-01 00:00:00', `publish_up` = '1000-01-01 00:00:00', `publish_down` = '1000-01-01 00:00:00';
This is happening because since MySQL 5.7, MySQL stops supporting zeros value in date / datetime. Restart MySQL and you are done!
In that case your documentation is wrong. As I read that link to the php issue then its only for a specific version of php 7.2.8 and not generic to mysql8 and joomla. Your documentation implies that the problem is for everyone trying to use joomla with mysql8
@brianteeman The issue @BilalReffas linked in his last comment is the wrong one as that indeed seems related to a specific PHP version. However in the wiki we have the link to the PHP 7.3 commit, which is this one: php/php-src@d6e81f0
This fixes the MySQL 8 authorization in PHP.
That is exactly the case. The reason is because they changed the password hashing. This is not something we can fix in Joomla, the PHP MySQL client must be updated.
This is not only Joomla but any PHP application and even Sequel Pro on Mac for example. These won't work until the clients are updated to handle the new password mechanism.
Surely the correct way to "resolve" this is to add a test for mysql8 in the preinstall check and display any message there. Displaying it here on every database installation error will just confuse people - remember most users wouldnt know if they were using mysql8 or not.
Except you can't. Because to get the database version, the client has to be able to connect to the server, and right now we can't even reliably establish a connection.