pycsw icon indicating copy to clipboard operation
pycsw copied to clipboard

MySQL Database Setup fails

Open georgr opened this issue 11 years ago • 3 comments

The database setup (pycsw-admin.py -c setup_db) on MySQL with InnoDB engine fails with error https://gist.github.com/georgr/9187261 and the records table does not get created. I locally fixed that by changing all String(256) fields in the admin.py file with String(255).

Another error occurs afterwards when the first issue is fixed: https://gist.github.com/georgr/9187297 I locally fixed this one by setting the index parameter of the column Column('links', Text, index=True), to False.

With those two hacks it seems to run with mysql.

georgr avatar Feb 24 '14 12:02 georgr

As I look at versions of admin.py from around the time this issue was made, I can't see where there are any String(256) fields listed there. They all seem to be Text fields. I had a related problem to this, however, on RedHat 7 and MySQL with InnoDB:

Running the database setup (./bin/pycsw-admin.py -c setup_db -f default.cfg) produced the error "BLOB/TEXT column 'identifier' used in key specification without a key length". I added String to the imports from sqlalchemy and changed all Text fields that were primary keys or indexed to String(length=255) and this resolved the error.

I don't have enough experience with pycsw to know whether or not changing these datatypes will have any side effects or consequences down the road.

flathers avatar Feb 22 '17 00:02 flathers

@flathers I can confirm that this solves the reported problem

stopopol avatar Sep 12 '17 11:09 stopopol

@stopopol @flathers

Thanks for your investigation. Improving our test coverage on MySQL is something we have to work on, as it usually does not receive the same amount of love as postgresql and sqlite.

Hopefully with #534 we'll be able to streamline the process of setting up some test instances and improve the situation.

I'm leaving this open for now, but will revisit later, when the time comes.

Unless you want to submit a PR with the proposed changes?

ricardogsilva avatar Sep 12 '17 13:09 ricardogsilva