Access denied error when syncing Notion to MySQL in CloudQuery

Hello dear, I am facing this error while syncing data from source Notion to MySQL destination plugin.

PS C:\Users\waqas\cloudquery-config> .\cloudquery.exe sync notion.yaml mysql.yaml
Loading spec(s) from notion.yaml, mysql.yaml
Error: failed to sync v3 source notion: failed to init destination mysql: rpc error: code = Internal desc = failed to init plugin: failed to initialize client: Error 1045 (28000): Access denied for user 'user'@'localhost' (using password: YES)

Can anyone help me troubleshoot this issue?

Hi @nearby-anteater,

It seems the wrong credentials are being used for the MySQL plugin. Can you verify that you can connect to MySQL directly using the same credentials via a tool like MySQL Workbench?

Yes, I can connect to MySQL and can create databases and tables in it. However, I’m getting an error in the connection string:

connection_string: "mysql://mysql:test@localhost:3307/cloudquery"

I’ve tried the above and also the ready-made syntax available on the CloudQuery site. Here, test is my password and mysql is the username.

Can you share the full configuration spec?

integration: from Notion (source plugin) to MySQL (destination plugin)

Notion.yml code:

# Please insert your Notion plugin code here

MySQL.yml code:

kind: destination
spec:
  name: "mysql"
  path: "cloudquery/mysql"
  registry: "cloudquery"
  version: "v4.0.8"
  spec:
    connection_string: "mysql://mysql:test@localhost:3307/cloudquery"

But when I start syncing data, it gives an error of “MySQL access denied.”

Hi @nearby-anteater, can you please remove the Notion secret from your message?

Also, please try using the following connection string:

connection_string: "mysql:test@localhost:3307/cloudquery"

Make sure to omit mysql:// and use just mysql:test@localhost:3307/cloudquery. Thank you!

Error: failed to sync v3 source notion: failed to init destination mysql: rpc error: code = Internal desc = failed to init plugin: failed to initialize client: invalid MySQL connection string: default addr for network 'localhost:3307' unknown

Can you try mysql:test@tcp(localhost:3307)/cloudquery?
See examples from here.
This is the Go library we use and support the connection string format from.