Bug #49295 Data export fail when using TCP/IP over SSH
Submitted: 1 Dec 2009 20:22 Modified: 15 Feb 2010 11:16
Reporter: Todd Farmer (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench Severity:S1 (Critical)
Version:5.2.10 r4680 OS:Windows (XP)
Assigned to: Alfredo Kojima CPU Architecture:Any

[1 Dec 2009 20:22] Todd Farmer
Description:
Connected to a remote server using TCP/IP over SSH to test data export.  While I was able to select the schema and tables I wanted to export, when this was actually executed, it tried to execute it against my local instance:

12:11:56 Dumping management (bit_test )

Running: mysqldump.exe --no-create-info=FALSE --order-by-primary=FALSE --force=FALSE --no-data=FALSE --tz-utc=TRUE --flush-privileges=FALSE --compress=FALSE --replace=FALSE --host=127.0.0.1 --insert-ignore=FALSE --extended-insert=TRUE --user=root --quote-names=TRUE --hex-blob=FALSE --complete-insert=FALSE --password=mypass --port=3306 --disable-keys=TRUE --delayed-insert=FALSE --delete-master-logs=FALSE --routines=FALSE --comments=TRUE --add-locks=TRUE --flush-logs=FALSE --dump-date=TRUE --allow-keywords=FALSE --create-options=TRUE --events=FALSE management bit_test 

mysqldump: Got error: 1045: Access denied for user 'root'@'localhost' (using password: YES) when trying to connect

This is a *huge* problem - it allows the possibility of executing a backup against server A while WB actually generates the backup from server B (locally).  If it happens that the same account can be used locally and remotely, and the same tables exist on both servers, the export will succeed, but contain schema and data from the wrong server.

How to repeat:
Try to use data export against a server with TCP/IP over SSH connection.
[20 Jan 2010 22:21] Alfredo Kojima
Added support for SSH tunnel to export/import code.
[12 Feb 2010 22:26] Johannes Taxacher
fix in repository confirmed
[15 Feb 2010 11:16] Tony Bedford
An entry has been added to the 5.2.16 changelog:

When MySQL Workbench was connected to a remote server using an SSH connection, and a data export operation performed, then MySQL Workbench actually attempted to perform the data export on a local server instance, rather than on the connected remote server. If the remote and local server had a common user account, then a backup could be performed that appeared to complete successfully, but which contained data from the local server rather than the connected remote server.