On Tue, Jan 9, 2018 at 10:19 AM, Zach Bonjour <
zbonj...@vibrantcreditunion.org> wrote:

> ...
> ERROR: Unable to execute constraint query
> ALTER TABLE guacamole_0.9.13.guacamole_user_permission add CONSTRAINT
> `guacamole_user_permission_ibfk_2`
> FOREIGN KEY (`user_id`)
> REFERENCES `guacamole_0.9.13`.`guacamole_user`
> (`user_id`)
> ON UPDATE RESTRICT
> ON DELETE CASCADE
> . Error: Query failed. 1064 (42000): You have an error in your SQL syntax;
> check the manual that corresponds to your MySQL server version for the
> right syntax to use near '.13.guacamole_user_permission add CONSTRAINT
> `guacamole_user_permission_ibfk_2`
> ' at line 1
> ubuntu@ip-172-31-11-33:~$
>
>
Perhaps the guacamole_0.9.13 in your ALTER TABLE needs to be quoted because
of the periods in the name? ie:

ALTER TABLE `guacamole_0.9.13`.guacamole_user_permission ...

If you didn't write this statement yourself, it looks like mysqldbcopy is
generating invalid SQL. I'm not sure if there's any difference in what
happens behind the scenes between mysqldbcopy and mysqldump, but you might
try just using mysqldump to dump the contents of the original database, and
then run that script against the new database. That's how I've always
handled backing up or copying MySQL databases in the past.

You could also try using a database name that doesn't need to be quoted,
like guacamole_0_9_13 or similar.

- Mike

Reply via email to