mysql
I have created a MySQL table. How to edit the value length? Because i didn't see any button or menu to do edit. Please help, TIA
56 Replies
Project ID:
N/A
N/A
for this kind of thing i recommend dbgate
hi Brody, what is that? I'm new to this thing
a database client, have a look at their website - https://dbgate.org/
okay, will look for it. thank you! do you mind if I contact you if I have any question?
for railway questions, of course
[Solved]
@Brody i want to link an Id as a foreign key from another table. How to set it? I just see
is primary key
in DbGate table setup
I found it!happy you found it, but thats not quite a railway question
I test the connection to my Android app, it keeps return 500. i have set the variable in .env same as railway variable. i don't know what's wrong
what environment variables are you using in code for your mysql credentials?
i put railway variables in .env
do you get this error when making a post request to your app running on railway?
yes, get the same error.. if connection successful it should be displaying user's data
have you added the database credentials to your service variables?
https://docs.railway.app/guides/variables#service-variables
yeah, you haven't set any service variables
click the banner and let it auto complete the variables for you
if done right you shouldn't be copy pasting anything
I only added the railway variables for the public network. there are 2 for public and private, right?
Does this matter? should I also add private variables?
yes it's added automatically, but still not working
for your usecase the public variables are just fine
can you send another screenshot of the service variables
did you copy paste anything?
there was 'add all' button, it's added auto
okay, can you show me what the raw editor shows the variables as? hiding anything that is sensitive please
(on on your app's service, I didn't need to see the variables on the mysql service)
ah, I inspect the RAW EDITOR
.env file in service is in different format from .env in MySQL
don't worry about that right now, .env is not applicable for railway
please show me a screenshot of the raw editor window for your apps service, hide anything that is sensitive
so if you had to redact those database variables, it means you didn't let it auto complete
i have ensure all the values are the same as MySql
please delete the database variables and use the auto complete
if you at any point copy paste something you would be doing it incorrectly
https://docs.railway.app/guides/variables#autocomplete-dropdown
wait, let me delete all
do not use that
not 'add all' button?
your .env file should absolutely not be in your repo
yes I forgot to use .gitignore ;_;
use the auto complete as shown here
done, still not working.. hmm
well now lets see what the raw editor has
alright that will do
please delete the .env file from the repo and get it in the .gitignore file
okiee, pls wait
done Brody. I delete again all variables in service. what to do next? do the same to import auto complete variables through the dropdown?
use the autocomplete to add these variables to the service
done. still error 500
in the service's settings, I use the public URL in my Android Retrofit
it's https right?
yes https
what do the deploy logs say in your railway deployment?
Server is running on port 6949
thats all?
yess
well thats not helpfull
you will need to add debug logging to your app
console.log('Generated Token:', token);
I add this log in scriptyou need more verbose logging, theres a code issue here but theres not enough logging to find out whats going on
can I post the logcats here?
yes
not supported authentication mode, what does it mean?
I use JWT token btw
before I deploy to railway it's working fine (running on local IP)
i don't know what's wrong ðŸ˜
okay now we getting somewhere
you need to use the
mysql2
npm package instead
it works!!!
aaah thank you very much Brody
no problem!
I'm going to get my lunch soo have a nice day!
you too!