Error: Unable to remove table from database “mydb.create_synonym_db”.
-
Hello,
When installing a package, during the install database step, I got this error:
INSTALL ERROR! DATABASE CREATION FAILURE! Unable to remove table from database "mydb.create_synonym_db". Please remove all tables from this database and try the installation again. If no tables show in the database, then Drop the database and re-create it. ERROR MESSAGE:
(the error message is empty)
The database was freshly created, has no table, no view, no stored procedure. I’ve recreated it a couple of times to be sure, it doesn’t help.
There are a few people complaining on this but I could not find any helpful things, for example: https://wordpress.org/support/topic/not-able-to-install-backup-after-step-2/
So I’ve looked at the installer php files, and found this function in “dup-installer/ctrls/ctrl.s2.dbinstall.php”:
private function dropProcs() { $sql = "SHOW PROCEDURE STATUS"; $found = array(); if ($result = mysqli_query($this->dbh, $sql)) { while ($row = mysqli_fetch_row($result)) { $found[] = $row[1]; } if (count($found) > 0) { foreach ($found as $proc_name) { $sql = "DROP PROCEDURE IF EXISTS <code>".mysqli_real_escape_string($this->dbh, $this->post['dbname'])."</code>.<code>".mysqli_real_escape_string($this->dbh, $proc_name)."</code>"; if (!$result = mysqli_query($this->dbh, $sql)) { DUPX_Log::error(sprintf(ERR_DBTRYCLEAN, "{$this->post['dbname']}.{$proc_name}")."<br/>ERROR MESSAGE:{$err}"); } } } } }
It seems that it tries to drop ALL the procedures from ALL the databases (“SHOW PROCEDURE STATUS” lists all the procedures for ALL databases).
The “create_synonym_db” procedure is there by default on my MySQL installation, and is present in the “sys” database, so this seems to incorrectly try to drop it.
If I edit the file and change the SQL with “”SHOW PROCEDURE STATUS WHERE db = ‘mydb’” then it works.
The error message is very confusing, as it says it is unable to drop a table (where in fact this is a procedure, and from a different database).
Can this please be fixed?
- The topic ‘Error: Unable to remove table from database “mydb.create_synonym_db”.’ is closed to new replies.