Description:
When attempting to use the 'Administration - Data Import/Restore' interface in MySQL Workbench to import a self-contained SQL file to a MySQL Server with PAM authentication enabled (requiring cleartext passwords), the import process fails with an error including this message:
ERROR 2059 (HY000): Authentication plugin 'mysql_clear_password' cannot be loaded: plugin not enabled
This occurs despite the fact that 'Enable Cleartext Authentication Plugin' is checked in the 'Advanced' tab of the MySQL Server connection in use.
How to repeat:
Given a MySQL Server instance with 'plugin-load = authentication_pam.so' set and the requisite library present in its plugin path:
# Use MySQL Workbench to prepare a connection profile containing the username and password of an account having authentication type PAM.
# Prepare a self-contained SQL/dump file to import.
# Use the 'Administration - Data Import/Restore' interface of MySQL Workbench to select the prepared SQL/dump file.
# Optionally select a target schema.
# Click 'Start Import.'
# Observe log output similar to the following:
14:01:59 Restoring C:\Users\someone\somewhere\somedump.sql
Running: mysql.exe --defaults-file="c:\users\someone\appdata\local\temp\tmpvpnier.cnf" --protocol=tcp --host=localhost --user=mvaughn --port=28405 --default-character-set=utf8 --comments --database=someone_test < "C:\\Users\\someone\\somewhere\\somedump.sql"
ERROR 2059 (HY000): Authentication plugin 'mysql_clear_password' cannot be loaded: plugin not enabled
Operation failed with exitcode 1
14:02:01 Import of C:\Users\someone\somewhere\somedump.sql has finished with 1 errors
Suggested fix:
Check the value of the 'Enable Cleartext Authentication Plugin' option from the current connection context and, if true, apply the --enable-cleartext-plugin argument to the 'mysql' command invocation.