Support

Site Restoration

#41999 Problems restoring database on MySQL with certain default values

Posted in ‘Site restoration’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

PHP version
n/a
CMS Type
Other
CMS Version
n/a
Backup Tool Version
10.0.3 Pro
Kickstart version
8.0.6

Latest post by nicholas on Sunday, 15 June 2025 10:24 CDT

petekuhn

Just passing this on to you, Nicholas, in case you hadn't seen it.

Had a problem cloning a site when the restore of the database errored out (1064) on a field with DEFAULT CURDATE()

which is allowed since MySQL8.0 but specified with parens around DEFAULT (CURDATE())

We were in the process of transitioning our live site from MySQL (8.3) to MariaDB (10.11), so one of our test sites was on MySQL and another on MariaDB. The error only occurred on the MySQL site, not on the MariaDB site. So fixed by updating both of our test sites to MariaDB.

The interesting thing is that SHOW CREATE TABLE doesn't have the CURDATE() in parens, nor does the file created by mysql_dump. But you can load the dump file without a problem under both versions.

Again, no problem at all, just passing on the info. Love the software.

nicholas
Akeeba Staff
Manager

I am trying to reproduce your issue.

Created a table on MySQL 8.0 with this definition:

CREATE TABLE `curdate_test` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'Untitled',
`when` date DEFAULT (CURDATE()),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

When I do a SHOW CREATE TABLE `curdate_test` I do get the default value expression in parentheses – in fact, what I pasted above is exactly that, as I forgot to write down my create command which simply lacked the charset and collation compared to what MySQL spat out.

When I take a backup of this site, the SQL dumped is exactly as I have it above. This makes sense, since we just run a SHOW CREATE TABLE and save the result in the SQL dump file. We only construct ourselves the INSERT commands for the table data.

Restoring this backup on MariaDB also works.

I am not sure what is happening in your systems, but it's not something I can reproduce following your instructions, I'm afraid.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

petekuhn

Maybe related to MySQL version, which is 8.4 for me. Anyway, not a problem for me, as I said, having changed to MariaDB with everything OK.

nicholas
Akeeba Staff
Manager

The MySQL version is not as important, since you told me that the column definition is DEFAULT (CURDATE()), with parentheses. As I told you, we just store the CREATE TABLE command as the SHOW CREATE TABLE command spat it out, changing the table name (replace the prefix with #__) and foreign key constraints (replace the prefix with #__). We don't change the DEFAULT value. We have no reason to.

So, was your table defined the way you said it was defined, or not? If you are adamant it was defined with a default value expression in parentheses then what you described is impossible to reproduce.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!