-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
db-import fails to wipe tables in MySQL 8 #52
db-import fails to wipe tables in MySQL 8 #52
Comments
Haven't tested, but looking at the code latest and greatest is affected as well. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions and please check out this if you are wondering why we auto close issues. |
Done another test run. Lando v3.0.26: $ lando db-import db.sql.gz
Preparing to import /app/db.sql.gz into database 'database' on service 'db' as user root...
Emptying database...
NOTE: See the --no-wipe flag to avoid this step!
Gzipped file detected!
Importing /app/db.sql.gz...
Import complete!
$ lando db-import db.sql.gz
Preparing to import /app/db.sql.gz into database 'database' on service 'db' as user root...
Emptying database...
NOTE: See the --no-wipe flag to avoid this step!
Dropping activity_log from database database...
ERROR 1347 (HY000) at line 2: 'database.activity_log' is not VIEW Lando v3.1.4: $ lando db-import db.sql.gz
Preparing to import /app/db.sql.gz into database 'database' on service 'db' as user root...
Emptying database...
NOTE: See the --no-wipe flag to avoid this step!
Gzipped file detected!
Importing /app/db.sql.gz...
Import complete!
$ lando db-import db.sql.gz
Preparing to import /app/db.sql.gz into database 'database' on service 'db' as user root...
Emptying database...
NOTE: See the --no-wipe flag to avoid this step!
Dropping activity_log from database database...
ERROR 1347 (HY000) at line 2: 'database.activity_log' is not VIEW
|
The current MySQL wipe implementation in db-import tries to execute https://github.com/lando/cli/blob/main/plugins/lando-services/scripts/sql-import.sh#L117-L124 Where the table exists and is not a view, this throws an error on MySQL 8 (8.0.26 here).
If we can make the same permissions assumption as the pgsql implementation already does (that the executing user can drop and create DBs) then the We are already deleting all tables and views in the DB, at which point I think that a DB drop is both faster and more accurate - no other artefacts (errr, triggers?) will be preserved. Confirmed with lando/cli@d139cd3 |
I can reproduce the problem on the drupal9 recipe with MySQL replaced with version 8. Not sure how to test this PR though. |
Hi ! I have the same issue here on Mysql 8.0 ➜ back-end git:(develop) lando db-import b28....0882de.sql.gz
Preparing to import /app/b28....0882de.sql.gz into database 'laravel' on service 'database' as user root...
Emptying laravel...
NOTE: See the --no-wipe flag to avoid this step!
Dropping activity_log from laravel database...
ERROR 1347 (HY000) at line 2: 'laravel.activity_log' is not VIEW I thinks yes since the option --no-wipe exists, we could drop the entire database and re-create it after. |
I've been having the same issue lately.
The only workaround I have found is to destroy the lando, start it and then run the import. Seems to work everytime. Kinda annoying though. |
Can confirm this is still an issue with lando v3.6.4 Emptying drupal9... |
Hi, I still have the same issue. I've created a workaround to allow DB importation in Lando.
|
I stopped using
Are those affected by this issue doing something different from most folks? I submitted lando/cli#59 ages ago but need to re-test and address that test failure. |
I'm still experiencing the same issue on the WordPress recipe. I have also experienced it on Pantheon as well. |
Same issue from lamp recipe. Any workarounds? |
- Refs lando/lando#2679 - Replaces lando/cli#59
Workarounds are either wipe the DB manually, or use the --no-wipe flag. Only use the latter if you know the database to not have changed. Especially tables that are in the current database but are not in the dump can give trouble (e.g. a table that gets created by installing a module that is only present on development systems, for instance). |
I'm chiming in that this bug just hit me when using MySQL 8. It wasn't a problem before when I was using MySQL 5.7. |
I've worked around this by copying the Replace the portion of the script where it queries and deletes the tables with this, which (1) queries the views and deletes them, then (2) queries and deletes the tables:
The tooling bit from
|
Kinda ridiculous that this is still an issue. mysql 8 is becoming more and more of a requirement in places, and it can't natively support something as simple as a database wipe. I've considered kerasai's solution (thanks!), but given that I'm not losing anything more than the DB I already wanted removed (and about 20 seconds of my life), I'll just keep doing the |
I've been running into this recently, too. My workaround is to ssh onto the database instance and drop/recreate the db, after which the
|
I'm also running into this with a lamp recipe with mysql 8.0. I'm running Drupal, so my workaround is to do a |
Lando version: v3.0.14
Lando file
db.sql.gz
The text was updated successfully, but these errors were encountered: