SpringBoot with MySQL on railway setup
Hey I am learning SpringBoot and was working locally with a MySQL db set up(locally as well), and I thought of making one in the Railway and connect it up to the SpringBoot code that I wrote.
Anyone knows how to do that? Like I need to do stuff in the application.properties right? but cant figure out what to put in exactly. if anyone can help, appreciate it
![No description](https://cdn.answeroverflow.com/1147530702917730445/Screenshot_2023-09-02_190718.png)
9 Replies
Project ID:
N/A
n/a
^ write that or the thread will close
n/a
So if I understnad correctly, you wanna make an sql database on railway?
yes
i made one for trying out, but couldn't figure out how to connect it with the springboot stuff
then you'd want to create a Database on railaway
you can do so by right clicking on your project's page and clicking on database
and then selecting the db you wanna use
![No description](https://cdn.answeroverflow.com/1147531221493092362/image.png)
after that, you just use the env variables railway provides to connect to it from your project
you can read more about ^ here: https://docs.railway.app/develop/variables
![No description](https://cdn.answeroverflow.com/1147531712885170287/image.png)
ok ill try it out