Importing Entity Database Model from MySQL to Visual Studio 2010 - mysql

Im trying to get Entity Data Model with wizard from remote MySQL server. I'm typing proper connection string, then choose next. I see all tables, i can check them. When wizard finished im getting no entity models and this errors:
Unable to generate the model because of the following exception: 'The provider did not return a ProviderManifestToken string.
Access denied for user 'myserver'#'myIP' (using password: NO)
P.S. Server Explorer and database sets working fine, I can write/read table data.
Environment:
Database:
Windows 2008 Server R2 (Enterprise)
MySQL Workbench 5.2
MySQL Connector Net 6.4.4
Client:
Windows 7 64bit Professional
Visual Studio 2010
MySQL Connector 6.4.4
.NET Framework 4
My Connection String:
metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=MySql.Data.MySqlClient;provider connection string="server=myserver;User Id=myID;database=myDatabase;password=myPassword"

I ran into similar issues. The connection string was good, and I could grab data from my application, server browser, etc. But whenever I tried to update the schema, the Entity framework would ignore the password in the config.
Workaround - Temporarily give the anonymous user all the necessary permissions on your mysql instance (in my case, local to my machine, so no security threats) and run the model update from Visual Studio. This way, a password won't be necessary.
Once all the entities are updated, go back and revert the permissions to the way they were.
It's not ideal, and I still don't know what the issue is, but it got me past the problem.

Related

How to connect Visual Studio to Aurora MySQL DB?

In Visual Studio 2019 menu: Tools -> Connect To Database I see "MySQL Database" data provider, but an attempt to connect to my aurora database finishes with weird error:
"Microsoft Visual Studio / Unable to connect to any of the specified MySQL hosts. Sequence contains more than one matching element"
I have Aurora DB based on MySQL 5.6.10. I can connect to it using the latest MySQL Workbench 8.0.18. I have the latest "MySQL for Visual Studio 1.2.9" and Connector/NET 8.0.18. I work with .NET Framework 4.7.2. I can also connect to other (normal) MySQL instances from the Visual Studio, but not to Aurora DB.
My final target is to create ADO.NET Entity Data Model from the amazon db, but this fails on the same error message.
Is there any guide how to connect MySQL Aurora DB with .NET Framework (not .NET Core)? A guide to extremely simple application which can download single value from any table would mean a significant step forward for me.
OK. I found it's a Bug #97448 introduced in MySql.Data 8.0.18. Workaround is to define server name by IP address instead of xxx.rds.amazonaws.com address.
It's a know bug.
FYI the previous version of mysql.data (v6.10.9) is also affected.
As a workaround you could resolve the DNS value to an IP address manually.
In the code example below I check if the server value is an IP then I resolve the DNS name when the value is not an IP address.
if (IPAddress.TryParse(server, out var ipAddress))
{
// The server value is an IP address, it can be used directly
}
else
{
server = Dns.GetHostEntry(server).AddressList.FirstOrDefault()?.MapToIPv4().ToString();
}
return new MySqlConnectionStringBuilder
{
Server = server
// ...
};

Entity Framework 6 and MySQL base first

I want to use exist db on mysql from mvc asp.net.
I installed mysql plugin for vs and mysql connector net.
Add connection string to config.
When I start vs in server explorer I see working connection, but when in project I try to add new ado.net entity data model -> generate from database wizard don't know about mysql in general, there are defaultconnection to MS sql and only two varients for new connection:
Microsoft SQL Server
Microsoft SQL Server Database file
Other
Maybe I forgot something install?
Thanks for help.

Connecting to remote mySQL via Excel VBA

Likely a dumb question but brain isn't piecing this together---
tl;dr: My main question is how do I choose the right parameters for my connection string? How do I determine what my driver should be? Provider? Option? Where do I find a list of acceptable parameters? How do I choose between ADO and OLE?
Objective: to connect to a hosted mySQL db of which I am admin.
Problem: creating a successful connection string / choosing the right parameters.
I'm new to referencing remote databases. Been looking all day today and yesterday; there are tons of articles and posts out there but nothing is working for me--I'm just trying to replicate what I see being done when I need to just design the string properly, but I don't know where to start.
I've tried using ActiveX Data Objects 2.7, 2.8 and 6.1 libraries. Also tried using OLE DB Simple Provider 1.5 Library. Below tests are using ADO 6.1.
Tried these connection strings:
DRIVER={MySQL ODBC 5.3 Unicode Driver};SERVER=ipaddress;PROVIDER=SQLOLEDB;DATABASE=xxx;UID=xxx;PWD=xxx;
---Error: waits ~30 seconds, times out and says Invalid Connection String Attribute
DRIVER={MySQL ODBC 5.3 Unicode Driver};SERVER=ipaddress;PROVIDER=Microsoft.Jet.OLEDB.4.0;DATABASE=db_name;USER=xxx;PASSWORD=xxx;
---Error: immediately errors and says cannot find installable ISAM
SERVER=ipaddress;PROVIDER=SQLOLEDB;DATABASE=xxx;UID=xxx;PWD=xxx;
---Error: waits ~30 seconds, times out and says SQL Database does not exist or access denied
I'm sure i've added the correct user with password and permissions. I haven't done anything with DSN.
I'm on win8.1 x64 using Excel 2013. Any advice is much appreciated!!

Migration of web application backend MS Access 2003 to MS Access 2010

I have an asp application residing on Windows server 2003 -32bit and backend for the application is MS Access 2000. When I upgrade it to MS Access 2010, it throws error: 'Unrecognized Database format'
I even tried to upgrade Access driver on server but of no luck.
What am I missing?
Make sure you have the ACE drivers installed. You said you updated the Access driver on the server but I'm not sure you actually installed the drivers that are needed for the new .accdb format.
By default, Windows only contains drivers for Jet, that allow you to use .mdb Access databases without installing anything new.
On the other hand, the new 2007/2010 Access format '.accdb needs to have the drivers installed separately.
You also need to make sure that your connection string to the database is updated:
string constr = #"Provider=Microsoft.ACE.OLEDB.12.0;Mode=16;Data Source=C:\...\mydb.accdb;user id=;password=;";
In addition to upgrading the database file itself from .mdb to .accdb you'll need to make two changes on the server:
You'll need to download and install the Access Database Engine, available here.
You'll also need to update your connection details for your ASP application. For a DSN-less connection you'll have to update your connection string to one of the formats described here. For example, an OLEDB connection string will have to be updated to Provider=Microsoft.ACE.OLEDB.12.0;.

Migrating from MS SQL to MySQL: SQLOLEDB? Migration kit login error?

I've been put in charge of migrating a customer's website of MS SQL/ASP to PHP/MYSQL. I have zero experience with MS SQL.
I'm trying to figure out the best way to get the current data migrated to MySQL so I can begin PHP development.
Some details:
I downloaded SQL Server Mangement Studio Express. I found the following string in a connection file:
MM_connCompanyName_STRING = "provider=SQLOLEDB;data source=IP_ADDRESS;database=DATABASENAME;uid=USERNAMEpwd=PASSWORD;"
Using the IP, username, and password from this string, I could successfully connect using Studio Express.
I downloaded the MySQL Migration Toolkit and entered the same info, but get the following error:
Connecting to source database and retrieve schemata names.
Initializing JDBC driver ...
Driver class MS SQL JDBC Driver
Opening connection ...
Connection jdbc:jtds:sqlserver://IP_ADDRESS:1433/DATABASENAME;user=USERNAME;password=PASSWORD;";charset=utf-8;domain=
The list of schema names could not be retrieved (error: 0).
ReverseEngineeringMssql.getSchemata :Login failed for user 'USERNAME'.
I don't have admin or physical access to the current SQL server. I've tried to run some exports through Studio Express, but it saves them to the file system, which I don't have access to.
I can reach the current/old webmaster, but because he no longer works for the company, his responses are slow and usually un-helpful. So no help there...
The former admin sent me an MDF file ... no idea what to do with that.
I found this note above the connection info on the current server (if it means anything):
'this connection is being used because
ODBC was causing weird errors,
switching to OLEDB fixed them
My questions:
Any idea why this would be failing with the same login credentials that works with Studio Express? I'm assuming it has something to do with the driver, but I don't know what next steps to take.
Is there a better/easier/more effective way to migrate this data? (I'm hoping I don't find myself running "SELECT *" statements in Studio Express and copy/pasting data into Excel...please god, no)
Thanks in advance for your help.
Eww, this is going to be scary (connection string indicates it was tool generated from Dreamweaver, never a good sign).
Any idea which version of SQL Server? You should be able to SELECT ##VERSION. 10.x is 2008, 9.x is 2005 and 8.x is 2000. If it is 7.x run.
The MDF file is the actual database. If I were you, I would buy a developer edition of SQL 2005 (or 8 if it is 2008 which is unlikely), it will be worth the $99 or so it costs.
This will give you the ability to locally install the DB by ATTACHing the MDF file. Once you have a locally running copy, you can use the SQL Server ETL tools with the MySql ODBC drivers to push the data to MySql in a repeatable manner.
I believe you can export data from MSSQL choosing different SQL dialects; I believe there's one that's reasonably MySQL compatible. It doesn't solve all your problems, of course, because while you may get the structure properly, stored procedures and triggers and the like will take a bit more work. But that should get you started.