9 months ago
I use the .env below:
#Conexao com SEMMARH
DB_HOST=177.185.136.26
DB_USER=root
DB_PORT=3306
DB_PASSWORD=mysenha
DB_NAME=gerenciamento_produtosPinned Solution
9 months ago
A lot of MySQL servers just block outside connections by default. Try connecting from your own computer with:mysql -h 177.185.136.26 -u root -p
If it doesn’t work, it’s probably a firewall thing or the server only lets local apps connect. In that case, double-check that port 3306 is actually open to the world. If your MySQL is on a cloud server, you might need to add the Railway’s IPs to its firewall or security group so it lets your app through. Also make sure that the user (like root) is allowed to connect from outside, not just from localhost
Also check if the DB name, user and pass are spelled right. Maybe a space or hidden space is the actual problem lol.
2 Replies
9 months ago
A lot of MySQL servers just block outside connections by default. Try connecting from your own computer with:mysql -h 177.185.136.26 -u root -p
If it doesn’t work, it’s probably a firewall thing or the server only lets local apps connect. In that case, double-check that port 3306 is actually open to the world. If your MySQL is on a cloud server, you might need to add the Railway’s IPs to its firewall or security group so it lets your app through. Also make sure that the user (like root) is allowed to connect from outside, not just from localhost
Also check if the DB name, user and pass are spelled right. Maybe a space or hidden space is the actual problem lol.
9 months ago
Ok! Using this configuration on my local computer works, I'll check if there's something wrong with the external connection.
Status changed to Solved chandrika • 9 months ago
