Install staging build
Install joomla
SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: '0000-00-00 00:00:00' for column 'lastResetTime' at row 1
Category | ⇒ | Installation SQL |
Labels |
Added:
?
|
Status | New | ⇒ | Information Required |
Yes, able to duplicate this error. Unable to install new Joomla 3.5 site on PHP 7.0.0 / Apache 2.4.17 / Mysql 5.7.9
Setting in Joomla MYSQL (PDO) Fails creating Admin User
Joomla Setting Mysqli works correctly.
It appears that 0000-00-00 00:00:00 is an invalid value for a datetime using PDO for MySQL.
The other option, reading up on things, seems it may also have something to do with a combination of NO_ZERO_DATE
and a combination of STRICT_TRANS_TABLES
and STRICT_ALL_TABLES
modes being enabled, and this wouldn't be MySQL version dependent (although 5.7 does use different defaults compared to 5.6).
I do not believe this is a MySQL 5.7 issue. If so, it would fail using the mysqli driver, but it only fails on the PDO driver. In testing the two drivers, are the settings of NO_ZERO_DATE, STRICT_TRANS_TABLES and STRICT_ALL_TABLES altered. In testing, I only changed the setting of the database connection in Joomla, Apache, PHP and MySQL are not change my me in the testing, but I do not discount the possibility that the DatabaseDriver alters these settings in code on Joomla 3.5
mbabker, are you using MySQLi or PDO as a database connection in Joomla for your test ? For me, MySQLi works as expected, PDO fails.
Thanks, Craig
The database driver doesn't alter the sql_mode at all. And all my local tests were with PDO on MySQL 5.6.
I note the 5.7 difference since according to the documentation the default sql_mode for 5.7 is a setting that would prevent the 0000-00-00 00:00:00 date from working (if I've read it right). I couldn't imagine why it would only affect the PDO driver and not the other MySQL based drivers too, but that's not something I've got a setup to dig into at the moment.
and removing the NO_ZERO_DATE in my.ini does correct the issue for MySQL 5.7. Thanks Michael. Good spotting..
Craig.
Yes clearing the sql_mode in the PDO driver fixes this issue.
I altered JDatabaseDriverPdo in pdo.php at line 217, replacing line 217 and 218 with this code.. Note that there is not break for pdomysql until after mysql.
case 'pdomysql':
if (empty($this->options['driverOptions']))
$this->options['driverOptions'] = array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET sql_mode=""');
else
$this->options['driverOptions'][PDO::MYSQL_ATTR_INIT_COMMAND] = 'SET sql_mode=""';
case 'mysql':
hope this helps in the short term. The reality is that driverOptions may be needed in the configuration.
Regards,
Craig
yes removing all sql modes fixed the issue
Thank you for creating this but it would appear that this has been resolved elsewhere in the code base. If this is not correct then this can be re-opened
Status | Information Required | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-05-08 15:27:31 |
Closed_By | ⇒ | brianteeman |
What were you doing to get that error message.
From what you have written I guessed it was during the install when using mysql(pdo) as the database driver.
I tested current staging and installed it with no sample data, blog sample data and testing sample data. All installed fine with no errorrs
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9310.