I have been trying to connect to db on EC2 from my local machine, I am not able to do and have tried many steps such as inserting data through my application to my Ec2 database using the connection string but failed came up with a database fail connection error, i also tried to deploy my application to my ec2 which seemed to have worked however i can see the folders but the files are missing. i tried to look for answer on the internet however there are too many different ideas.
Can anyone provides guidance or help would appreciate it. thanks in advance
Related
I have several sites hosted on the same App Service Plan - an S1 instance. All are using the same set out Outbound IPs. I have a SQL server VM where all the databases live. I have a network security group with an inbound rule for the S1's outbound IPs.
All my other sites work perfectly and have access to the SQL VM and their respective databases.
The site in question works perfectly when hosted from my local dev machine, WITH the production database.
Yet I get an Access Denied error: "SqlException: A network-related or instance-specific error occurred...] when I promote it to production on Azure.
All the usual suspects (firewall, user doesn't exist, etc.) can be ruled out because ALL my other sites are using the same database server, credentials, and the only change in the connection string is the Initial Catalog. They are all on the same App Server and all have the same outbound IP so if one was getting blocked the others would be also. If it were a user problem, it wouldn't work when hosted locally.
The only difference between this and my other web apps is that this one is Blazor, built on .Net 6. The others are on .Net Core 3.1 (LTS). I don't think that has any bearing since the application in question, when hosted locally works with the production connection string. This IS the first time I've published a Blazor app and .Net 6 app, so...
I'm sure I'm missing something silly, but I can't figure out why this one site would act differently than the rest.
Could someone please offer up another avenue for me to pursue? Or, a way to get a more verbose error message from the failed connection? Anything to further my troubleshooting?
For anyone reading this, I found my issue and it's unique to my project.
The truth, I separated the DAL from the presentation of the site. In the end, I was editing the wrong appsettings.json file. For three hours. Face-palm
My apologies if I wasted anyone's time.
I was working on my project that was using remote heroku postgresql database, that was working fine. Actually, I was using the sqlalchemy library to connect to remote database and I was also used to queries that remote database through my Ubuntu terminal by using psql name_of_remote_database_url command. But after sometime it is giving me a bundle of errors.
And my project was on flask web application now, I am getting errors from this also.
enter image description here
I tried so much but I failed so, that's why I am posting my question here! If anyone knows then plz explain!
pg_hba.config something looks like this
Please read following Heroku support information:
FATAL: no pg_hba.conf entry for host "…”, user “u…”, database “d…”,
SSL off
You are attempting to establish a database connection without SSL. SSL
is required for all connections. Please see the documentation for your
postgres driver on how to establish encrypted connections.
Recommended solution:
Heroku Postgres & SSL
Actually, I was using remote heroku database url. After sometime, heroku did maintenance of my database and changed the url and I was considering the problem related to my system, but it was not related to that.
When I visited my gmail there was written in the heroku gmail that we changed the url of your remote database during maintenance.
Now, it's working fine!
I have just finished the development of my application on asp.net mvc connected with SQL server, and I will love to deploy it. I want to use Azure App service, but I got an error "Unable to connect to master or target server 'DATABASE_NAME'. You must have a user with the same password in master or target server 'DATABASE_NAME'". I have tried every thing I found online like modifying the SSDT, but nothing changed.
Please is there any recommendation to fix this issue? If not, Please what are other ways for me to launch the application. The application will be used internally for Sales purpose and I don't need any fancy hosting. Thank you in advance.
Did you setup the sql azure firewall to accept connections from your computer?
Even if you set it up once, it is possible that your internet provider attributed a different IP address to your computer. So you must redo your firewall set up again for your computer to be accepted.
It is important to know that only sql logins/passwords are accepted here. So you must give the login/password of the admin user that you mentioned at the moment of creation of you sql server azure (there is a step that sets it up when you create your azure database), or the login/password of a user you created and granted in this database.
I am unsure about how to best resolve this issue. I have been working on a MVC application that requires user authentication, so I set up the project to use individual accounts, all well and good, it works fine.
However it saves the account data into a local db instance. I am at the stage where I want to host the application on a amazon web server I am renting. Publishing it to here has been fine, but now it can't connect to the local db so the sign up / register is no longer working.
My question is, can I somehow take this local db with me to the server, or do I need to generate a SQL script from it and deploy it on a local instance of SQL Express, and if so, how? I have had no luck with my attempts at either and would greatly appreciate any help.
Thank you.
I've never done this as Local DB is not recommended for anything in production so I'm not sure if it's allowed in AWS. In Visual Studio at the top of the solution explorer window there is a button to "Show all files" you should then see the hidden MDF local db file within the App_Data folder. Ensure that this file is being published to AWS.
I had 2 GAE apps running wordpress and connecting to a single cloud SQL instance.
As of just a few minutes ago I'm guessing both apps can not longer connect.
My IP address is whitelisted and I'm able to connect to the SQL instance without an issue, it's just the App Engine instances that are having issues.
The error is the standard WordPress error "Error establishing a database connection"
We have not changed anything, maybe someone from Google can chime in?
So far I've tried rebooting the Cloud SQL instance which did not resolve the issue.
I resolved the problem. The issue was that the MySQL user has to have a 'wp_user'#'localhost' account. You can't just have a 'wp_user'#'%' which seems odd because % is a wildcard so you'd think it would match everything. But somehow with the way GAE authenticates with Cloud SQL it needs to have the localhost user.
And because of the caching configuration the cause of this issue must be a change I made with the MySQL users a number of days ago. And the error only surfaced today. Gotta love caching.