Open csandanov opened 6 years ago
@csandanov another way is to run a mysql optimize to rebuild the indices mysqlcheck -o -udrupal -p drupal
Isssue
When using
mariadb-init
bind mount for database import Drupal 7 does not build indexes when visit the site first time. I check indexes after the first visit via:show index from system;
Column cardinality is still
0
. Reproducible with Vanilla Drupal 7.61 (-4.9.2
) and MariaDB 10.2.18, 10.3.10 (-3.3.9
)However when import performed via
drush sqlc < file.sql
ormysql db < file.sql
after the full init/start of mariadb, indexes built correctly after the first visit.Couldn't reproduce this issue with Drupal 8.
Workaround
Do not use import via
mariadb-init
bind mount, instead import manually post-start. You can rename your dump file inmariadb-init
bind mount fromdump.sql
ordump.sql.gz
to something likedump.txt
so MariaDB would ignore it during init. Then access mariadb container after it has started viadocker-compose exec mariadb sh
and run:mysql -udrupal -drupal drupal < /docker-entrypoint-initdb.d/dump.txt
This is not a valid mysql command, it has to be
mysql -u drupal -pdrupal drupal < /docker-entrypoint-initdb.d/dump.txt
Isssue
When using
mariadb-init
bind mount for database import Drupal 7 does not build indexes when visit the site first time. I check indexes after the first visit via:Column cardinality is still
0
. Reproducible with Vanilla Drupal 7.61 (-4.9.2
) and MariaDB 10.2.18, 10.3.10 (-3.3.9
)However when import performed via
drush sqlc < file.sql
ormysql db < file.sql
after the full init/start of mariadb, indexes built correctly after the first visit.Couldn't reproduce this issue with Drupal 8.
Workaround
Do not use import via
mariadb-init
bind mount, instead import manually post-start. You can rename your dump file inmariadb-init
bind mount fromdump.sql
ordump.sql.gz
to something likedump.txt
so MariaDB would ignore it during init. Then access mariadb container after it has started viadocker-compose exec mariadb sh
and run: