hello, I try to dump my database with MYSQLDUMP but always get an empty document and the following :
stderr: /bin/sh: 1: mysqldump: not found
@project: 61093780-ada7-48c8-baad-204a654316a2
@environment: 0b5788ca-bc3b-456d-a1a0-c42c007e2298
@service: 14af0899-5217-4b4f-9e54-c69259616607
@deployment: 84841e48-988d-4bb0-87c3-8ee91cee31ad
@replica: 8d9753a9-0f14-4a7a-9a41-bf45f44f177b
how use mysqldump in railway or install int? ty
13 Replies
Project ID:
61093780-ada7-48c8-baad-204a654316a2,0b5788ca-bc3b-456d-a1a0-c42c007e2298,14af0899-5217-4b4f-9e54-c69259616607,84841e48-988d-4bb0-87c3-8ee91cee31ad,8d9753a9-0f14-4a7a-9a41-bf45f44f177b
Yes but MYSQLDUMP is already installed :
railway run mysqldump --version
Warning: World-writable config file '/usr/local/etc/my.cnf' is ignored
mysqldump Ver 10.19 Distrib 10.11.2-MariaDB, for osx10.17 (x86_64)
okay then why are you getting a command not found error?
stderr: mysqldump: Got error: 1698: "Access denied for user 'root'@'localhost'" when trying to connect
hum
please read the guide I linked
the HOST was missing in my code
it's good now !
const dump = spawn('mysqldump', [ '-h',${process.env.DB_HOST}
, '-P',${process.env.DB_PORT}
, '-u',${process.env.DB_USER}
,-p${process.env.DB_PASSWORD}
,${process.env.DB_NAME}
, ], { shell: true })
are you doing an in code backup?
Yes, il send my database backup par mail
via email?
yes
it's bad ?
it's certainly unique
probably not the best idea
railway has a few templates that backup a database to an S3 based storage solution, please look into those
oh! okay thanks