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

Etherpad MySQL create database is wrong #6

Open
JohnMcLear opened this issue May 6, 2015 · 7 comments
Open

Etherpad MySQL create database is wrong #6

JohnMcLear opened this issue May 6, 2015 · 7 comments

Comments

@JohnMcLear
Copy link

https://github.com/tvelocity/dockerfiles/blob/master/etherpad-lite/entrypoint.sh#L41 is incorrect

See https://github.com/ether/etherpad-lite/wiki/How-to-use-Etherpad-Lite-with-MySQL

Patch landing now.

JohnMcLear added a commit to JohnMcLear/dockerfiles that referenced this issue May 6, 2015
TEST BEFORE MERGE Fixes tvelocity#6
@tvelocity
Copy link
Owner

You are right on the UTF-8 character set issue; however, the proposed patch does not approprietely resolve the problem. The etherpad-lite instructions call to run etherpad-lite, stop it and then convert the database to UTF-8.

Unfortunately, setting the charset before the database has been initialized by etherpad-lite, does not work. A proper fix would be a bit more complex, and until then the charset has to be tweaked manually.

Maybe one way to do it would be to import a mysql dump of a properly configured database. It's a pity etherpad doesn't handle this by itself.

@JohnMcLear
Copy link
Author

including ALTER TABLE store CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; should do it?

@tvelocity
Copy link
Owner

Unfotunately you have to do it after etherpad-lite has already initialized the database. Otherwise you are losing UTF-8 content between restarts of etherpad (I've tested with Greek, but the problem is the same with any non-latin character set).

I've been thinking about it, and I see 2 ways to fix it:

  1. Include a preconfigured, ready for UTF-8 content mysql dump
  2. On first time runs, shutdown the etherpad process a while after it has started, and then run the alter table command.

Until then UTF-8 users will need to alter the database manually (as I did on my setup).

@JohnMcLear
Copy link
Author

A dump is probably a grood way to do it

cc @webzwo0i who is working on the solution from the Etherpad Side of things.

@webzwo0i
Copy link

hey, I cannot look into this right now, but what I think is that the need to run epl is probably pure convenience. If we ever change the db-layout we would need to change the dockerfiles too, but until then you could do:
https://github.com/Pita/ueberDB/blob/master/mysql_db.js#L63 and then run ALTER DATABASE and ALTER TABLE without the need to run epl in between. You probably also need to INSERT INTO store (key,value) VALUES(MYSQL_MIGRATION_LEVEL,1); to prevent ueberDB from changing the table again. It will check if MYSQL_MIGRATION_LEVEL is 1 and if not run https://github.com/Pita/ueberDB/blob/master/mysql_db.js#L84

@tvelocity
Copy link
Owner

Thanks, I'd like to try that when I have some time! :)

@JohnMcLear
Copy link
Author

@webzwo0i any time to look into this issue this week? I'd love to see your PR land with the fix in =)

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

Successfully merging a pull request may close this issue.

3 participants