I am trying to setup a local server for testing which I am planning to host the following:
Spring-Boot Application for the Backend Application (port:8080)
Angular 4 App for the Frontend Application (port:4200)
MySql Database for the Database (port:3306)
When I am trying to test using the local server, everything works fine.
The problem occurs when I try to access the server from another PC. I can't seem to access the MySql Database of the server from another PC through my frontend app.
Problem:
access using the server:
localhost:4200/login - able to login (connects to the server's MySql DB)
access using another PC:
192.168.179.18:4200/login -unable to login (connects to the other PC's MySql DB)
NOTE: 192.168.179.18 is the server's IP address.
It seems that when I try to access the frontend app from another PC, it is trying to connect to the other PC's local MySql Database.
How do I configure this so that where ever I access the server, it will access the server's MySql Database??
btw, my application.properties looks like this:
spring.datasource.url=jdbc:mysql://localhost:3306/my_app_database
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.username=root
spring.datasource.password=root
spring.jpa.database=mysql
spring.jpa.hibernate.ddl-auto=none
I found the cause and a solution. It turns out that in the FrontEnd App, it is hardcoded there to connect to localhost:8080 so where ever I access it, it will try to locate localhost:8080. When I was testing this, I was running the backend app(port 8080) on the other PC that's why it accessed the other PC's MySql Database.
What I did was changed the hardcoded localhost:8080 to 192.168.179.18:8080 so that it will communicate with the backend app on my server.
Related
I am very new to ngrok, so please bear with me.
I have a very simple React test app that is using Django as a server and local MySQL database. Django pulls/inserts some info from the local database and sends to the frontend. Everything works well.
What I'm trying to do is expose this local app to public Internet. I have successfully installed and configured Ngrok, established a tunnel and was able to view the app on a different computer through the address generated by Ngrok. The problem is, I was able to see only the UI that is not related to the database. All data that React pulls from the local database, was not visible when I used a different computer. My question is, is there a way to use the same app through Ngrok and get the same data from the local MySQL database that I see when I just run the app locally? I know that I can create another tunnel that exposes the port MySQL or Django are running on (3306 and 8000 respectively) but if I do this, how would I access the data through Ngrok? Would I need to change anything in React code?
Thank you in advance!
I have already deployed my node app with heroku which is working fine with my local phpmyadmin database but how can i use it without starting mysql on local machine.
OR how to connect my node app deployed in heroku with phpmyadmin(mysql2)
You shouldn't use local MySQL database in the production app which you have deployed in a hosting provider in this case Heroku.
You could create a remote MySQL database resource from providers like db4free.net.
Update your code to use database credentials of the remote database and start using it.
Note Heroku also provides a MySQL service. You could set up your database there too if you need.
I’m am trying to use Microsoft WebMatrix version 3 to create and publish a WordPress site to an IIS 8.0 server.
I have created the WordPress site from the WebMatrix App Gallery and as part of this process MySQL has been installed locally on my PC.
I have configured the IIS server for Web Deploy. I have created a website in IIS, I would like to publish my new wordpress site to. I also created a remote database on another server which has MySQL server installed. As part of the publish process, I would like the local database to get published to this remote database. As of now, it is an empty database with a valid username and password.
From within IIS, when I create the publish settings file I get the following error:
"Unable to establish a connection to the MySQL database using the supplied connection string. Would you like to add the connection string to the XML settings file"
I click save and proceed.
When I use this settings file to validate the connection inside Web Matrix. I get the following error.
"The remote server connection succeeded, but Microsoft WebMatrix cannot access databases."
Related info. I have verified that my remote database is available by connecting to it directly from within Web Matrix. The port 3306 is open. I don't know what else I need. Stumped for several days now :-(
Any suggestion will be greatly appreciated.
I have a MySQL database on another windows computer (a server) that is setup locally using remote desktop connection for testing.
How can I connect to that local database to Visual Studio 2010 on "my computer"?
Server Computer(MySQL database setup local) --> My Computer(Visual Studio for test code..)
I am new to MySQL and any suggestions will help.
Thanks
PS: I have found this, but the "Server Name" for the database is 127.0.0.1 which I can't use because it is local on whatever computer you are on.
http://geekswithblogs.net/mbridge/archive/2010/12/13/visual-studio-2010-hosting--connect-to-mysql-database-from.aspx
You'll have to use the address of the computer that it is hosted on. It should be the same as the address you use to connect to the remote desktop session.
You might need to configure the firewall to accept the connection. You also might need to setup MySQL to allow remote connections with the user that you authenticate with.
I would recommend downloading MySQL workbench and install it on your local computer. Once you get the connection working with that, you should be able to use the connection with VS2010.
If you're not sure how to do the things listed above, you'll need to start out with a basic tutorial on setting up MySQL for remote connectivity.
I developed a project in VB.NET
In this project I want to use data from MySQL that is resides in my WEB Server.
I can communicate with the MySQL server of my localhost but can not communicate with the WEB Server.
In my CPanel I added Host from the Remote Database Access
But I can't communicate with WEB MySQL Server.
Please help me.
The first step is to try to connect to the web mysql with MySql Query Browser - that will tell you if the database is open for remote connections ( I assume it would fail)
I guess you have already checked it, but make sure you use the correct ip
EDIT:
As Björn said, your vb code is ok, so the problem is with the connection to the db.
Unfortunately that would be caused by many many reasons.
Are you sure you use a real IP from the host (and use it in the mysql settings)?
Are you sure you entered the correct remote host in the mysql settigns?
Are you sure you have correct connection string in the vb code?
Since your post indicates you can access the DB on your localhost, it doesn't seem to be an issue with the way you're connecting to the DB from your application (.NET-Connector?).
What does the external MySQL-Server say? Access denied? Or can't you reach it from the pc where your application is hosted (aka maybe a firewall regulation, other network etc.)?