Description:
In MySQL Workbench > Server Administration > Data Import/Restore:
When using Import from Disk (from Self-Contained File in this case), to a connection which has an SSL CA File specified on the 'Advanced' tab (where connection mode is Standard (TCP/IP)), after clicking 'Start Import', the operation fails with:
mysql.exe: unknown variable 'defaults-extra-file=c:\users\...'
How to repeat:
Create a new connection to a server with a SSL CA Cert file:
Connection method: Standard (TCP/IP)
On Advanced tab, check 'Use SSL if available' and provide the path to the SSL CA file.
In Server Administration, Create a server instance using this connection, then open that instance.
In Data Import/Restore > Import from Self-Contained File, provide an sql file to import and click 'Start Import'.
Suggested fix:
After searching about this, it seems the problem might be that the --defaults-extra-file parameter must be the first parameter. However, when the connection is using a CA Cert, the mysql command echoed to 'Import progress' has the --ssl-ca parameter first, before the --defaults-extra-file parameter, e.g.:
mysql.exe --ssl-ca=c:\path\cert.pem --defaults-extra-file="c:\users\user\appdata\local\temp\xxxxx.cnf" --host=xxxxx --user=xxxxx --port=3306 --default-character-set=utf8 --comments < "c:\\path\\export.sql"
I think that inserting the --defaults-extra-file parameter first in the generated command would fix this.
A problem with testing this is that the generated string references a tmp file for defaults-extra-file, which is deleted after the error. However, I confirmed that the import works from the command line when the --defaults-extra-file is placed first, and using my my.ini file instead of the temp file.