when i am running my asp.net website in my local system (Database connection with phpMyAdmin host server link), it is working fine. But after upload the program to host server panel it gives mysql connection error. I have attached mysql.data.dll using nuget package. Refer the picture.
Can please suggest the good solution?.
Local IIS Result
Host Domain Result
Please refer the above pictures for errors.
To fix the issue, the application was published and then deployed to host server as a sub-application under Default website.
Related
I have a local project, that is a webapi (.net core 3.1) that connect with MySql (local server), good.
What I want to achieve, is do an image of my webapi (to pass then to production), I can do the image OK. But when I run the image, and I navigate via browser, I get the following error:
Microsoft.EntityFrameworkCore.Database.Connection[2004]
An error ocurred using the connection to database 'nameOfTable' on server 'localhost'
I didn't dockerize the mysql server, it's running as always, on local. I didn't change de user or the password... so I don't understand why I get this error.
Thanks in advance for your help!
When you run a container with your Web API image, the container has its own network and also IP address. If your MySQL instance works your local machine, not on docker-engine, you must have to connect your local to your docker container somehow which is not suggested. Instead of that, you may run a MySQL container that uses your local MySQL data (you can mount a local folder to the container with -v/volumes).
I'm following the tutorial for deploying a Django app on Google App Engine here. I'm able to run the app locally using cloud_sql_proxy, but when I deploy the app to GAE the app fails with the error:
(2003, "Can't connect to MySQL server on 'localhost' ([Errno 111] Connection refused)")
Checking the error output, it looks like django is trying to connect to the unix socket at /cloudsql/<project>:<region>:<instance> as expected, it's just failing for some reason. What could be causing this issue?
It looks like the problem was with the project I was using for the tutorial. Somehow the Google App Engine service account for that project had gotten its permissions revoked. After restoring those permissions (giving it the Editor role) the tutorial worked on the original project.
You need to change the database connnection in the Django settings.
appengine/standard_python37/django/mysite/settings.py
The settings.py file contains the configuration for your SQL database. The code in settings.py uses the GAE_APPLICATION environment variable to determine whether the app is running on App Engine or running on your local computer:
When the app runs on App Engine, it connects to the MySQL host by using the /cloudsql Unix socket.
When the app runs on your local computer, it connects to the MySQL host by using TCP, which requires a username and password.
Read the bottom of the documentation, here
Edit: make sure you've enabled the Cloud SQL API.
I have a MySQL server database running on Azure. It has already running to store data from my ASPX web apps hosted on Azure also. I have plan to migrate the apps to Java JSF or .net core.
I developed using Tomcat server (in my local pc) and try to connect directly to mySql in Azure. But I always get Communications link failure error.
Is it not allow to connect directly from my local Tomcat server to database in Azure, or something else?
Thank you in advance for the answer.
Yes you can connect from your local tomcat to your azure mysql if you have provided the correct connection string.
Also add your ip in the firewall rules of the sql resource.
My app seems to run fine sometimes, and other times it says it cannot connect to any of the MySQL servers.
I started out with the MySQL server being hosted in azure as well, but I moved it external due to connectivity issues.
I finally moved the ASP.Net app to a real VM instead of being hosted as a website. I tested a manual connection to the MySQL server when it became unresponsive and it failed as well. I then did a trace route to the server and it failed as well.
Is this a known issue? Is this a duplicate of: Classic ASP site on Azure web site, remote mysql database
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.