2 years ago
I need help to connect and make work all the start configurations and deploys how caan i do this?
51 Replies
2 years ago
After you paid your bills, you just need to restart all the deployments
2 years ago
What error are you getting?
2 years ago
Does it fail to connect within your code as well?
2 years ago
and you didn't change any of the variables or mess with the volume in any way?
2 years ago
odd, what specific error in your code are you getting when you try to connect though?
XHRGET
https://dev-regatea-back-dev.up.railway.app/bargaines/recents?perpage=8&page=1
[HTTP/2 500 229ms]
success false
code "ERR-500"
message "Unexpected error from database adapter: select failed (\"badConnection\"). A connection either could not be obtained or there was an error using the connection.\nAdditional data:\n\n{\n error: Error: ERNOTSUPPORTEDAUTHMODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client\n at Sequence.packetToError (/app/nodemodules/mysql/lib/protocol/sequences/Sequence.js:52:14)\n at Handshake.ErrorPacket (/app/nodemodules/mysql/lib/protocol/sequenc…ctions (node:internal/process/taskqueues:95:5) {\n code: 'ERNOTSUPPORTEDAUTHMODE',\n errno: 1251,\n sqlMessage: 'Client does not support authentication protocol requested by server; consider upgrading MySQL client',\n sqlState: '08004',\n fatal: true\n },\n meta: {\n host: 'localhost',\n port: 3306,\n schema: true,\n adapter: 'sails-mysql',\n url: 'mysql://root:-bFFG3fA3EfGc5B3g-d63gG3FGcFDc-H@monorail.proxy.rlwy.net:32787/regatea_test',\n identity: 'default'\n }\n}"
error Object { isOperational: true, adapterMethodName: "find", modelIdentity: "parameter", … }
2 years ago
are you using the mysql npm package to make this connection?
2 years ago
could you try using mysql2 instead? 🙏
2 years ago
Alright, in that case could you try appending the following to your MySQL service start command:
--mysql-native-password=ON-# (you can do this in your MySQL database-service's settings)
2 years ago
No no, you're not supposed to append it there, when you go to your database service, you need to click on Settings, then if you scroll down you'll find Custom start command, at the end of that custom start command, you just need to paste --mysql-native-password=ON
2 years ago

2 years ago
aand, did it work?
2 years ago
It's very strange, I'm completely out of ideas
2 years ago
Here's what happened, you deployed your MySQL database before MySQL databases got pinned to a specific version. This means every time you redeploy it, it'll deploy the latest version. This caused you to jump from something in MySQL 8 to MySQL 9, and since MySQL 9 doesn't support that native password plugin, you're softlocked out of the database, at least from what I can tell
lost connection to mysql server at 'reading initial communication packet' system error 0
2 years ago
I might have an idea, the current issue is authentication. We could try:
adding
--skip-grant-tablesto the start command to disable authentication on the MySQL databaseFrom there you can connect to the database and make a backup.
Then you could try making a new database and loading the backup onto the new database
this would of course temporarily expose your database though, without any authentication anyone could connect to it if they know the URL
but if you don't mind that then I think this could be worth trying
(note: remove the --mysql-native-password=ON that we added last time first before trying this)
2 years ago
You wouldn't be able to downgrade the MySQL deployment
2 years ago
You could tunnel through tailscale which would allow you to access the database without authentication with more security as it wouldn't be publicly exposed
a railway team member is working on a guide for that, but it won't be done until the end of the week
2 years ago
Sure, I can ping you when that guide is completed 🙂
2 years ago
@Pipenho The tailscale guide was published:
2 years ago
I did do some testing and I couldn't manage to get it working, I had trouble connecting to the database without auth using the --skip-grant-tables flag
However, it's very possible I just couldn't get it working due to ignorance (I don't use MySQL) so it might still be worth a shot since you're likely better at using MySQL than I am 🤣
2 years ago
If this doesn't work then I'm completely out of ideas 😭


