Created a environment like production and staging , now cant find my mysql db
neerajsupplyvan
PROOP

16 days ago

Created an environment like production and staging , now cant find my mysql db, the volume size of new mysql service shows 261Mb but i don't see my database, Is my data lost ?

$20 Bounty

19 Replies

Railway
BOT

16 days ago

Each environment on Railway is fully isolated, so when you created a new environment (e.g. staging), the MySQL service in that environment gets its own separate, empty volume - it does not share data with your original environment's MySQL. Your data is still in the original environment's MySQL service; switch back to that environment using the environment dropdown in the top navigation to access it.


Status changed to Awaiting User Response Railway 16 days ago


neerajsupplyvan
PROOP

16 days ago

but cant find it in both production and staging environment


Status changed to Awaiting Railway Response Railway 16 days ago


sam-a
EMPLOYEE

16 days ago

Your MySQL service is running and your data has not been deleted. The 261MB volume is just the base MySQL installation on a fresh, empty volume in the new environment.

When you duplicate an environment, volumes are not copied, so each new environment gets its own empty MySQL. Your original data lives in the original default environment that existed before you created the new ones. Check the environment dropdown in the top navigation for all environments in your project. There may be one beyond just "production" and "staging" since Railway creates a default "production" environment for every project. If you then created another environment also called "production," the original may appear with a different label.

Are you suggesting there was data in the database that is not there anymore?


Status changed to Awaiting User Response Railway 16 days ago


neerajsupplyvan
PROOP

16 days ago

we have already msql-volume has 261mb space, but how can we recover and get data from this volume ?


Status changed to Awaiting Railway Response Railway 16 days ago


16 days ago

The 261MB on that volume is just MySQL's base system files, not your data. When you duplicate an environment, volumes are not copied, so each new environment starts with a fresh, empty MySQL instance. Your data only exists in the original environment where it was created. Check the environment dropdown at the top of your project for any other environments beyond "production" and "staging." If you had backups configured on the original environment's MySQL volume, you can restore from those.


Status changed to Awaiting User Response Railway 16 days ago


neerajsupplyvan
PROOP

16 days ago

i see only production and staging , originally my data was in production and i newly created staging, now db is missing from both production and staging.


Status changed to Awaiting Railway Response Railway 16 days ago


16 days ago

There is still a database in production.


Status changed to Awaiting User Response Railway 16 days ago


brody

There is still a database in production.

neerajsupplyvan
PROOP

16 days ago

I am getting this error
Failed to Connect to MySQL at crossover.proxy.rlwy.net:20924 with user root
Access denied for user 'root'@'100.64.0.3' (using password: YES)

when i try to connect, everything was working fine until i created staging environment and then this happened.

By the way can you tell me the name of the db that you can see in production?


Status changed to Awaiting Railway Response Railway 16 days ago


16 days ago

We're not able to help with what may have been misconfigured on your end.


Status changed to Awaiting User Response Railway 16 days ago


Status changed to Open Railway 16 days ago


brody

We're not able to help with what may have been misconfigured on your end.

neerajsupplyvan
PROOP

16 days ago

Then what am I suppose to do? At least guide me on how I can resolve it at my end.


neerajsupplyvan
PROOP

15 days ago

Any resolution or steps to fix?


domehane
FREETop 1% Contributor

15 days ago

Hello neerajsupplyvan,

go to your production mysql service then variables tab and copy the exact value of MYSQLPASSWORD and use that exact value to connect, not an old cached one. when you created staging, the variable may have changed, i think that mismatch is why you're getting access denied, your data is still there

Hope this help you :)


  • Select MySQL service, Goto Variables tab

  • Copy variable value MYSQL_PUBLIC_URL

Use this to connect. You can see in variables to get info (i.e. public url, default database etc.) about any database services.


neerajsupplyvan

Any resolution or steps to fix?

avijitbhuin21
PRO

15 days ago

even if you can't connect to the db you should be able to see the data from the browser dashboard itself. first check and confirm if the data is intact or not. then we can check the variables to check if the value is updated or not. in either case take the public url and try to connect. if youre in the same prohect you can connect with the internal url as well.


bilalnawaz072

Select MySQL service, Goto Variables tabCopy variable value MYSQL_PUBLIC_URLUse this to connect. You can see in variables to get info (i.e. public url, default database etc.) about any database services.

Using the public URL will incur egress costs. It's better to use the internal URL whenever possible.


avijitbhuin21

even if you can't connect to the db you should be able to see the data from the browser dashboard itself. first check and confirm if the data is intact or not. then we can check the variables to check if the value is updated or not. in either case take the public url and try to connect. if youre in the same prohect you can connect with the internal url as well.

neerajsupplyvan
PROOP

15 days ago

I am able to connect now, but i don't see my database anywhere, only the default ones added by railway. Is my data actually gone?


avijitbhuin21

even if you can't connect to the db you should be able to see the data from the browser dashboard itself. first check and confirm if the data is intact or not. then we can check the variables to check if the value is updated or not. in either case take the public url and try to connect. if youre in the same prohect you can connect with the internal url as well.

neerajsupplyvan
PROOP

15 days ago

thanks able to connect now but I cannot find my database


neerajsupplyvan

thanks able to connect now but I cannot find my database

avijitbhuin21
PRO

15 days ago

generally that should not happen, did you turn on backup for this db? the check your backup tab it will be there. also make sure you are checking in the same environment you created the db earlier.


neerajsupplyvan

I am able to connect now, but i don't see my database anywhere, only the default ones added by railway. Is my data actually gone?

domehane
FREETop 1% Contributor

15 days ago

double check that the credentials you used to connect are from the production environment and not staging. both environments have a mysql service with different credentials. go to railway dashboard, make sure you are on production, then grab the variables from there and reconnect. the railway employee confirmed the data is in production so it should be there


Welcome!

Sign in to your Railway account to join the conversation.

Loading...