Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mysqldef] How can use SSL/TLS? #216

Closed
shiroemons opened this issue Mar 6, 2022 · 4 comments
Closed

[mysqldef] How can use SSL/TLS? #216

shiroemons opened this issue Mar 6, 2022 · 4 comments

Comments

@shiroemons
Copy link

shiroemons commented Mar 6, 2022

I am trying to see if I can connect to PlanetScale (MySQL8).

$ mysqldef --version 
v0.11.40
$ mysqldef -h example.psdb.cloud -u username -ppassword database_name > schema.sql
2022/03/07 00:25:22 Error on DumpDDLs: Error 1105: unknown error: Code: UNAVAILABLE
server does not allow insecure connections, client must use SSL/TLS

How can use SSL/TLS?

refs: Connecting to PlanetScale securely

@k0kubun
Copy link
Collaborator

k0kubun commented Mar 10, 2022

I implemented a relevant feature in v0.11.42. Could you try it again with v0.11.42?

@shiroemons
Copy link
Author

I tried, but got another error.

$ mysqldef --version
v0.11.44
$ mysqldef -h example.psdb.cloud -u username -ppassword database_name > schema.sql
2022/03/11 02:05:38 Failed to read '-': stdin is not piped

@k0kubun
Copy link
Collaborator

k0kubun commented Mar 10, 2022

Please try mysqldef -h example.psdb.cloud -u username -ppassword database_name < schema.sql instead.

@shiroemons
Copy link
Author

@k0kubun

Thank you! It worked!

$ mysqldef -h example.psdb.cloud -u username -ppassword database_name < schema.sql
-- Apply --
CREATE TABLE `user` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) DEFAULT 'hoge',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

I forgot to give the export option...

$ mysqldef -h example.psdb.cloud -u username -ppassword database_name --export > schema.sql

The export worked too!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants