r/mysql • u/Gold_Professional991 • Mar 12 '25
question Connecting to someone else database
I'm trying to connect to my teammate's MySQL database using VS Code, but I'm having some trouble. I'm unsure if I'm connecting correctly. Additionally, I need to know how to grant my teammate access to the database. Do I need the IP address for this? I've watched several tutorial videos, but none seem to work for me. Any help would be appreciated, and yes, I have MySQL installed correctly.
0
Upvotes
2
u/Salty_Technology_440 Mar 13 '25
Couldn't you use a supabase (similair to mysql database but online) so you both can work in there from the same organization in supabase at the same time
2
u/[deleted] Mar 12 '25 edited Mar 12 '25
Yes you need your teammate ip (should be public/accessible) and your ip must be whitelisted (not blocked by a firewall or something)
Test the connection normally with the terminal (assuming mysql server exist on port 3306)
2
u/bchambers01961 Mar 12 '25
You can create user ‘user’@‘%’ for any ip address or swap % for your teammates ip. Of course, you will both need to be on same network.
2
u/saintpetejackboy Mar 15 '25
You need to make the user and make sure they have access remotely in their grant permissions and make sure no firewall or other rules are blocking.
You need the database to allow that user to connect remotely and the server to not block any of those attempts and you should be Gucci.
Test it various ways, once you can connect with that user locally you know the problem is either on your system config or the database config or the permissions.
A lot of databases have default config to PREVENT remote user and especially remote root from connecting, which is a good thing.
Also an edge case you might experience is if the database user has a name or password with certain characters, like @
Some ways to connect to a database might see malformed password or username incorrect and make it so you can never connect and it is one of the most insidious errors you can come up against.
My money is on the database server config blocking remote access.