0

I have a MYSQL 8.0.28 server as well as phpMyAdmin running in docker containers. Everything seems to work except that when exporting the database to a dump file through phpMyAdmin one of the views has a syntax error in the dump file.

The SQL for the view has a 'GROUP BY' statement at the end and for whatever reason the last column in the statement is getting duplicated like this:

...
GROUP BY
    `db`.`table1`.`column1`,
    `db`.`table2`.`column2`,
    `db`.`table2`.`column3`

becomes

... 
GROUP BY 
    `db`.`table1`.`column1`, 
    `db`.`table2`.`column2`, 
    `db`.`table2`.`column3``column3`;

added line break to emphasise additional column name

Note that this is a legacy project that I am trying to fix (I did not create this view), and that I am somewhat of a novice when it comes to SQL.

I'm using the latest version of phpMyAdmin but am not averse to downgrading versions if this is a bug with phpMyAdmin

I'm also aware that using MYSQL to dump directly might be better but the users of this project would prefer that it can be done through a web interface.

4
  • I'll add that creating a dump with mysqldump worked as intended, so it actually does appear to be a bug with phpmyadmin Commented Feb 20, 2022 at 23:48
  • Sounds like a bug in phpmyadmin; file a bug report. Meanwhile, switch to the commandline "mysql".
    – Rick James
    Commented Feb 21, 2022 at 1:52
  • As I see the space between completely qualified name and the alias is lost.
    – Akina
    Commented Feb 21, 2022 at 5:18
  • MySQL always expands all object names in the view during its creation till complete name qualifying while taken the current database name into account. dbfiddle.uk/…
    – Akina
    Commented Feb 21, 2022 at 5:19

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.