Railway MySql database backup with DBeaver

rogerHOBBY

a year ago

Hey guys.
I'm trying to backup my Railway database using DBeaver and its 'dump database' tool, however I'm receiving the following error:
mysqldump: Got error: 2003: Can't connect to MySQL server on 'localhost:3306' (10061) when trying to connect

Task 'MySQL dump' finished at Wed Dec 20 13:45:05 BRT 2023
2023-12-20 13:45:05.592 - IO error: Process failed (exit code = 2). See error log.
2023-12-20 13:45:05.592 - java.io.IOException: Process failed (exit code = 2). See error log.
at org.jkiss.dbeaver.tasks.nativetool.AbstractNativeToolHandler.validateErrorCode(AbstractNativeToolHandler.java:263)
at org.jkiss.dbeaver.tasks.nativetool.AbstractNativeToolHandler.executeProcess(AbstractNativeToolHandler.java:241)
at org.jkiss.dbeaver.tasks.nativetool.AbstractNativeToolHandler.doExecute(AbstractNativeToolHandler.java:283)
at org.jkiss.dbeaver.ext.mysql.tasks.MySQLNativeToolHandler.doExecute(MySQLNativeToolHandler.java:47)
at org.jkiss.dbeaver.tasks.nativetool.AbstractNativeToolHandler.lambda$0(AbstractNativeToolHandler.java:87)
at org.jkiss.dbeaver.runtime.RunnableContextDelegate.lambda$0(RunnableContextDelegate.java:39)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)

Can someone help me ?
Note: the connection to the database has already been made and I can access the entire database, I just can't perform the dump.

11 Replies

a year ago

you need to connect to the railway hosted database in order to back it up


rogerHOBBY

a year ago

I'm already connected, so much so that I can export the data from each table individually to SQL format, I just can't export the database as a whole using DBeaver's dump database tool


a year ago

please read your error message

Can't connect to MySQL server on 'localhost:3306'


rogerHOBBY

a year ago

Yes, but I don't know how to solve this


a year ago

it would help if you connected to the railway-hosted database, not localhost


rogerHOBBY

a year ago

I am already connected to the the railway-hosted database, I can read, create, edit and remove data and tables from the database, I just can't perform the dump database operation


a year ago

Can't connect to MySQL server on '[localhost](localhost):3306'

as per your error message, you are trying to connect to localhost


rogerHOBBY

a year ago

Exactly, and I am not understanding the reason of this, because I already I'm connected to the database and have all access


rogerHOBBY

a year ago

I tried passing the connection variables in the 'additional command arguments' field:
-h.railway.app -uroot -p --port 6123 --protocol=TCP railway
It gave the following error: Got error: 2003: Can't connect to MySQL server on 'localhost:6123' (10061) when trying to connect.
Practically the same as before


a year ago

I would recommend checking out DBeaver's documentation to help you get more familiar with the software


rogerHOBBY

a year ago

I found the problem.
I was establishing the connection to the database through the Railway connection URL. After switching to establish the connection with Host, the dump databse tool worked.


Railway MySql database backup with DBeaver - Railway Help Station