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

Drush can not restore a DB from a MySQL Dump where is an MySQL view #2791

Closed
ArtuGit opened this issue Jun 2, 2017 · 2 comments
Closed

Drush can not restore a DB from a MySQL Dump where is an MySQL view #2791

ArtuGit opened this issue Jun 2, 2017 · 2 comments

Comments

@ArtuGit
Copy link

ArtuGit commented Jun 2, 2017

I created MySQL view in my database.

      CREATE OR REPLACE VIEW v_users AS
        SELECT u.uid,u.name, g.field_profile_gender_value as 'gender'
        FROM users u
        LEFT JOIN profile p ON u.uid = p.uid
        LEFT JOIN field_data_field_profile_gender g ON p.pid = g.entity_id

I created an SQL Dump using drush sql-dump | bzip2 > dbname_yymmdd.sql.bz2.
When I try to restore the DB from this Dump I get:

ERROR 1227 (42000) at line 32330: Access denied; you need (at least one of) the SUPER privilege(s) for this operation

If I delete this view and do a new Dump it works normally.

P.S. I try to restore the Dump using either of these commands:

#restore from an archive
bunzip2 < dbname_yymmdd.sql.bz2 | `drush sql-connect`
#restore from sql dump
drush sql-cli < dbname_yymmdd.sql
@ArtuGit
Copy link
Author

ArtuGit commented Jun 2, 2017

Drush Version : 8.1.10

@greg-1-anderson
Copy link
Member

This is not a Drush issue. The access denied error is being forwarded to you from your mysql server. If you want to import without deleting the view, then you must do as the error message said, and grant additional privileges to the mysql user being used during the import.

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

No branches or pull requests

2 participants