Database Connection Problem - Azure MySql Database Server from .net core 3.1 - mysql

-- Background:
I am using asp.net mvc project with 3.1 .net core.
I have azure setup for hosting it in app service.
For Database, I have mysql database server set up on Azure (version 5.7).
-- Problem:
I am using basic connection string when connecting to mysql database. But it is not working for hosted application.
When I connect the azure hosted database server locally using WorkBench, and run the program (locally), it 'works'. (WorkBench connection has Ssl = required and SSL cert File attached.)
But when I publish the same code with same connectionString, it is not working.
IS IT BCZ OF:
I am using 5.7 azure mysql database server?
(To update the version, do I need to create new mysql server on azure and pay $20? Because Mycrosoft documentation says there is 'Upgrade' option on overview. But there is not. Or might for higher subscription. Any suggestions?)
If the reason is I am missing mentioning ssl certi on hosted platform, how can I add it? Do I need to get storage to store that certificate? How can I mention that path in connectionString?
Any other reason for this problem?
I checked YouTube, Microsoft documents, And Google but didn't find solution.
UPDATE:
Libraries used:
MySql.EntityFrameworkCore 3.1.X
Microsoft.EntityFrameworkCore 3.1.X
MySql-Connector-Net 8.0.X
Connection String used: "Server=.mysql.database.azure.com;Port=3306;Database=;Uid=;Pwd=;"

Solution:
It was unable to connect because of incomplete networking.
I had to allow other azure services to connect that server.
Thanks for your comments.

Related

How to connect PowerBI desktop to Azure MySQL with SSL

I need to set up my connection with PowerBI to Azure Database for MySQL flexible server. I can't seem to find any reliable documentation to do this.
Initially I'm getting this error when I try to connect to the server.
Get Data > More > Select MySQL Database
Input the Server name and Database name > Hit OK
Error: Connections using insecure transport are prohibited while
--require_secure_transport=ON.
Then I downloaded the SSL certificate from our Azure portal then successfully imported in the certmgr.msc under the Trusted Root Certification Authorities
But the same issue persists. Please take note that in this same machine I was able to connect to that server using phpmyadmin. In DbBeaver as well by simply installing the SSL as a CA Certificate. What can I try next?
when you import the certificate you get asked to install it for current user or local machine. Have you tried importing it on local machine rather than current user. I have it on local machine and able to connect to the Azure database for mysql server. let me know if it works.
Thanks
Sunitha
Able to fix my issue by installing the latest mySQL connector and importing a public SSL Certificate.
my machine previously has a MySQL Connector Net 7.0.2 then I downloaded the latest 8.0.32 from this page: https://dev.mysql.com/downloads/connector/net/
thanks to this reference: https://learn.microsoft.com/en-us/azure/mysql/flexible-server/connect-with-powerbi-desktop

Connect a Flutter app to a MySQL database that's on a VM

For a school project, we want to create an app using flutter (dart + android studio), and for it we would need a database to which we connect the app.
We have two options :
A MySQL database that's hosted on our school's servers (on a Ubuntu VM, accessible from SSH with a host address, username an password)
Another MySQL database on our school's server, but hosted directly on a server for databases (no VM). For that one, we would have more 'common' logs as the host and port.
Here are the specs of the second one :
Linux Fedora Core 18 //
Apache/2.4.4 PHP/5.4.14 //
MySQL Community Server (GPL) 5.5.31 //
phpMyAdmin 3.5.8.1 (2013-04-24)
My question is, how can I access these sql databases (ideally using the second method) from my flutter app ? I know there's a way to access local MySQL databases from flutter, but as the base will be hosted on an external server, I don't know how to correctly connect and dialogue with it.
Thanks
I faced the same problem. The mysql1 package is not well maintained. Google Dart developers do not provide built-in support of RDBMS.
There is another package to work with mysql, maybe you can take a look. mysql_client
I think that the best solution is to create a restApi on your server to manage your crud operation with the mysql database. There are a lot of tutorials on how to create a node application that lives in your server and interact with your database.
This is also a good solution because you add a layer that manage all the back-end stuff of your application.

MySQL connection in Logic app required an on premise gateway by default - why?

I have an azure hosted MySQL data base and am now trying to use the MySQL connector in a logic app. Unfortunately the connector requires an on premise gateway as one of the mandatory requirements. I have read that I should disable SSL which is already the case. Any idea how I can make a connection to this DB?
MySql connector in logic app at this point allows you to connect to the on premises mysql database through an on premises datagateway. You cannot directly connect to the mysql database hosted on azure. The workaround for this is that you write an azure function which connects with the mysql databases and call the azure function in your logic app. The azure function can be a http triggered

could not access azure mysql

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.

Host MVC Application in AppHarbour

I've hosted MVC application having MySql server instance in AppHarbour as backend but build is getting failed. We would like to connect MySql instance from local application but it can't access tables and schema while is opening and connecting to instance successfully.
You can't connect AppHarbor to a local db. If you have a hosted MySql instance though, you can connect it to that.
AppHarbor shows you build errors. You can read the build output and find out why it is failing (if it is the build failing or unit tests failing).
Either way, whether or not MySql is hosted or local, that shouldn't affect whether or not the project builds in AppHarbor.