duckdb_mysql icon indicating copy to clipboard operation
duckdb_mysql copied to clipboard

Secret type 'mysql' doesn't exist when creating a persistent secret

Open hello-world-bfree opened this issue 9 months ago • 0 comments

What happens?

When trying to create a persistent secret, I get the error that Secret type 'mysql' does not exist yet when creating a temporary secret it does exist.

Error:

Invalid Input Error:
Secret type 'mysql' does not exist, but it exists in the mysql_scanner extension.

Please try installing and loading the mysql_scanner extension by running:
INSTALL mysql_scanner;
LOAD mysql_scanner;

Alternatively, consider enabling auto-install and auto-load by running:
SET autoinstall_known_extensions=1;
SET autoload_known_extensions=1;

The mysql_scanner extension has been installed and loaded:

Image

To Reproduce

Try to create the persistent secret:

create persistent secret mysql_prod (
  type mysql,
  host 'my-host.com',
  database my-db,
  port 3306,
  user 'my_username',
  password ''
);

Get the error:

Invalid Input Error:
Secret type 'mysql' does not exist, but it exists in the mysql_scanner extension.

Please try installing and loading the mysql_scanner extension by running:
INSTALL mysql_scanner;
LOAD mysql_scanner;

Alternatively, consider enabling auto-install and auto-load by running:
SET autoinstall_known_extensions=1;
SET autoload_known_extensions=1;

Try to create a temporary secret, succeed, and use the secret to validate:

create or replace secret mysql_local (
  type mysql,
  host '127.0.0.1',
  database my-db,
  port 3306,
  user 'root',
  password ''
);
attach '' as my_local (type mysql, secret mysql_local);
from my_local.existing_table;

OS:

iOS

MySQL Version:

8.0.32

DuckDB Version:

1.2.1

DuckDB Client:

CLI

Full Name:

Brandon Freeman

Affiliation:

Hallow

Have you tried this on the latest main branch?

  • [x] I agree

Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?

  • [x] I agree

hello-world-bfree avatar Mar 22 '25 22:03 hello-world-bfree