R
Railway15mo ago
Eikyuu

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
Percy
Percy15mo ago
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
Eikyuu
Eikyuu15mo ago
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)
Brody
Brody15mo ago
okay then why are you getting a command not found error?
Eikyuu
Eikyuu15mo ago
stderr: mysqldump: Got error: 1698: "Access denied for user 'root'@'localhost'" when trying to connect hum
Brody
Brody15mo ago
please read the guide I linked
Eikyuu
Eikyuu15mo ago
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 })
Brody
Brody15mo ago
are you doing an in code backup?
Eikyuu
Eikyuu15mo ago
Yes, il send my database backup par mail
Brody
Brody15mo ago
via email?
Eikyuu
Eikyuu15mo ago
yes it's bad ?
Brody
Brody15mo ago
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
Eikyuu
Eikyuu15mo ago
oh! okay thanks
Want results from more Discord servers?
Add your server