-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Problem connecting to MySQL via unix socket #6880
Comments
@ZacxDev Thanks for posting! We'll take a look as soon as possible. In the mean time, there are a few ways you can help speed things along:
Please remember: never post in a public forum if you believe you've found a genuine security vulnerability. Instead, disclose it responsibly. For help with questions about Sails, click here. |
Hello, sails ships with a default disk, while you feel your project is ready to connect to a database you have to define your connection variables by instaling the sails-MySQL plugin the feed in your variables adapter: 'sails-MySQL', |
Possibly related: #6888 |
I figure this post is relevant here too for MySQL friends (I was using Postgres but had same issue). -- I finally got Sails.js to work today with GCP SQL. If you follow the tutorials from Google you have either Unix Sockets or TCP options to try -- and sadly neither work with out of the box sails-postgres. My workaround was to connect via a VPC connector with a dedicated IP address. This way I can connect to Cloud SQL using a regular Postgres connection string, directly to the DB. https://cloud.google.com/appengine/docs/legacy/standard/python/outbound-ip-addresses Then I whitelisted the new dedicated IP in Cloud SQL security settings, and forced SSL to require valid SSL certificates. It may not be best practice for now, but it works -- and that's one less ticket in the "To Do" queue :) |
Node version: v10.15.3
Sails version (sails): 1.2.3
ORM hook version (sails-hook-orm): 2.1.1
Sockets hook version (sails-hook-sockets): 2.0.0
Organics hook version (sails-hook-organics): 0.16.0
Grunt hook version (sails-hook-grunt): 4.0.1
Uploads hook version (sails-hook-uploads): n/a
DB adapter & version (e.g. sails-mysql@5.55.5): sails-mysql@1.0.1
Skipper adapter & version (e.g. skipper-s3@5.55.5): n/a
Hey team,
I'm trying to connected to my production database using a unix socket path, I am trying to do this because it is the most secure way that GCP allows me to connect.
I looked into #6547, but couldn't get it to work, that issue was a few years old and it looks like they were messing with adapters.js, which does not exist in my installation of sails.
I've tried putting the datastore config both directly in config/env.production.js, as well as in config/datastores.js, with no luck.
Here is my configuration:
The errors I get vary depending on what I change, but it's usually either ERRCONNECT-REFUSED when it ignores my configuration and tries to use the default development one. Or it's a sails error saying my datastore is invalid because I'm not passing a connectionString:
Thanks for any help :)
The text was updated successfully, but these errors were encountered: