Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation issue: MySQL version #22

Closed
winks opened this issue Nov 13, 2018 · 5 comments
Closed

Documentation issue: MySQL version #22

winks opened this issue Nov 13, 2018 · 5 comments

Comments

@winks
Copy link

winks commented Nov 13, 2018

Describe the bug

When importing the provided schema.sql of 0.2.1 with MySQL < 5.6 this error appears:

ERROR 1293 (HY000) at line 99: Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause

Which is a known problem and is fixed with 5.6.
Yes I know 5.5 is old, but I suggest adding (5.6+) on https://writefreely.org/start at "A MySQL database" - it could make sense to also check the corresponding MariaDB version (should be 10.0 but I'm not sure) - if it works at MariaDB at all?

Version or last commit:
0.2.1

@thebaer
Copy link
Member

thebaer commented Nov 13, 2018

Great catch, thanks. I'll update the docs.

I know some people are using MariaDB, but I'm not sure what the minimum version would be to support this. Does anyone else know?

@thebaer thebaer self-assigned this Nov 13, 2018
@thebaer
Copy link
Member

thebaer commented Nov 13, 2018

Updated the site. Closing this now, and I'll update with MariaDB information if we figure that out.

@thebaer thebaer closed this as completed Nov 13, 2018
@jorins
Copy link

jorins commented Dec 25, 2018

This note appears to have been removed. There's no mention of it on the site, or in the readme. I ran into this issue as CentOS 7 uses MariaDB 5.5 as the default MySQL implementation, so it still seems noteworthy to me. Consider pointing the user here.

@thebaer
Copy link
Member

thebaer commented Jan 7, 2019

Added it back on that page again -- thanks for the reminder!

@gytisrepecka
Copy link
Contributor

As CentOS still ships MariaDB 5.5, some users might still have an issue initializing schema.sql.

For the reference, here is what would
./writefreely --init-db
return:

2019/03/02 02:14:49 Loading config.ini configuration...
2019/03/02 02:14:49 Connecting to mysql database...
2019/03/02 02:14:49 Creating table accesstokens...
ERROR: 2019/03/02 02:14:49 log.go:26: Error 1067: Invalid default value for 'created'
2019/03/02 02:14:49 Creating table appcontent...
ERROR: 2019/03/02 02:14:49 log.go:26: Error 1067: Invalid default value for 'updated'
2019/03/02 02:14:49 Creating table appmigrations...
2019/03/02 02:14:49 Created.
2019/03/02 02:14:49 Creating table collectionattributes...
2019/03/02 02:14:49 Created.
2019/03/02 02:14:49 Creating table collectionkeys...
2019/03/02 02:14:49 Created.
2019/03/02 02:14:49 Creating table collectionpasswords...
2019/03/02 02:14:49 Created.
2019/03/02 02:14:49 Creating table collectionredirects...
2019/03/02 02:14:49 Created.
2019/03/02 02:14:49 Creating table collections...
2019/03/02 02:14:49 Created.
2019/03/02 02:14:49 Creating table posts...
ERROR: 2019/03/02 02:14:49 log.go:26: Error 1293: Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause
2019/03/02 02:14:49 Creating table remotefollows...
2019/03/02 02:14:49 Created.
2019/03/02 02:14:49 Creating table remoteuserkeys...
2019/03/02 02:14:49 Created.
2019/03/02 02:14:49 Creating table remoteusers...
2019/03/02 02:14:49 Created.
2019/03/02 02:14:49 Creating table userattributes...
2019/03/02 02:14:49 Created.
2019/03/02 02:14:49 Creating table userinvites...
2019/03/02 02:14:49 Created.
2019/03/02 02:14:49 Creating table users...
ERROR: 2019/03/02 02:14:49 log.go:26: Error 1067: Invalid default value for 'created'
2019/03/02 02:14:49 Creating table usersinvited...
2019/03/02 02:14:49 Created.
2019/03/02 02:14:49 Updating appmigrations table...
2019/03/02 02:14:49 Done.

In my initial installation on fedi.dev I have modified tables accesstokens, appcontent, posts and users to match MariaDB 5.5 requirements, but probably it makes no sense request them pulled as newer MariaDB/MySQL versions doesn't need any modifications to original schema.sql.

I can confirm that with MariaDB 10.x there are no issues - tables gets created successfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants