Skip to content
Snippets Groups Projects
user avatar
lcottret authored
f1337804
History

Metexplore Test Database

Mysql dump of the MetExplore test database. The name of the database is metexplore_test.

How to create it ?

By command line, not with phpMyAdmin !

Don't forget to remove all the data that are not listed in the "What does it content?" section below.

mysqldump -u root -p --routines --triggers  --databases metexplore_test --default-character-set utf8mb4  > metexplore_test.sql

Remove sql_mode NO_AUTO_CREATE_USER

The dump can integrate NO_AUTO_CREATE_USER in the sql_mode variable. It's not compatible with the docker mysql version.

Solution: edit the sql file and remove them.

Remove the first line /*!999999- enable the sandbox mode */

Test the docker image to be sure that everything is ok

You can build the image with this command :

docker build -t test_db .

And test it using the image test_db.

docker run -d --name db test_db
docker exec -it db bash

If everything is ok, the bash of the container is launched.

If it fails, check the logs:

docker logs db

Don't forget to update VERSION in .gitlab-ci.yml.

Push the docker image in the registry

The docker image is pushed with gitlab CICD pipeline.

How to import it ?

You can use the image registry.forgemia.inra.fr/metexplore/metexplore-database:latest or build the database from the sql file:

mysql -u root -p < metexplore_test.sql

What does it content?

  • Three databaseRefs with 3 BioSources :
    • the iaf1260 coli model
    • the BioCyc 18.0 coli model
    • a small toy model
  • Three users:
    • admin
    • usertest1
    • usertest2

Usual bugs

default values for dates

To have CURRENT_TIMESTAMP as the default value for a date, the type of the column must be datetime and not date.

'date' datetime NOT NULL DEFAULT CURRENT_TIMESTAMP

No default value for TEXT, BLOB and JSON mode

These types are not allowed to have default versions in this mysql version.

Solution: remove the default values in the table and redo a mysql dump.

## collation not recognized when importing the database

Exemple : ERROR 1273 (HY000) at line 2900: Unknown collation: 'utf8mb4_0900_ai_ci'

Solution : replace utf8mb4_0900_ai_ci by utf8mb4_bin