I'm trying connect Google Cloud SQL with SSL on my Rails APP, use mysql cli with sslca, everything is fine.
$ mysql --ssl-ca=config/server-ca.pem --host=instance-ip --user=username --password
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1535
Server version: 5.6.26 (Google)
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
This is my database.yml
When I start rails server and try to access my website it show up
Mysql2::Error (Access denied for user 'username'@'my-public-ip' (using password: YES))
This confused me, it should be connect to Google Cloud SQL instance IP, but it change to my public IP??
Have any idea? Thanks for your watch