简体   繁体   English

如何配置MYSQL ODBC驱动程序以与Visual Studio 2013一起使用?

[英]How can I configure the MYSQL ODBC driver to work with Visual Studio 2013?

I've installed MYSQL server, running local on 127.0.0.1 (I've also tried this with MySQL server at a public IP with same results). 我已经安装了MYSQL服务器,该服务器在127.0.0.1本地运行(我也已经在公用IP的MySQL服务器上尝试了此方法,并且结果相同)。

Here is how I'm configuring it: 这是我的配置方式:

Using MySQL Connector / ODBC (running localhost mysql server) using Visual Studio 2013 C# 使用Visual Studio 2013 C#使用MySQL Connector / ODBC(运行本地mysql服务器)

I click Design tab of a webform.aspx page - and click and drag (from Toolbox->Data->GridView into the MainContent frame, and drop. 我单击webform.aspx页面的“设计”选项卡-并单击并将其从Toolbox-> Data-> GridView拖放到MainContent框架中,然后拖放。

VisualBasic2013网格视图

I then click the [>] button Under Choose Data Source, I choose to create a new data source. 然后,我单击[>]按钮。在“选择数据源”下,我选择创建一个新的数据源。

VisualBasic2013数据源配置向导

Under Data Source Configuration Wizard, I choose SQL Database. 在“数据源配置向导”下,选择“ SQL数据库”。

Next pops up a window, Configure Data Source - SqlDataSource1 接下来弹出一个窗口,配置数据源-SqlDataSource1

配置数据源

I click New Connection 我点击新建连接

添加连接

Microsoft ODBC Data Source (ODBC) is selected as Data source - I leave it (note: here, I have tried changing this to MySql Data Source - but the connection fails). 选择Microsoft ODBC数据源(ODBC)作为数据源-我将其保留(注意:此处,我尝试将其更改为MySql数据源-但连接失败)。 so I use the ODBC option. 所以我使用ODBC选项。

I click the () Use Connection string: and click [Build] 我单击()使用连接字符串:,然后单击[构建]

选择数据源

A window pops up, and I select the Machine Data Source tab 弹出一个窗口,然后选择“机器数据源”选项卡

I have already created a Data Source named test_localhost_mysql, I select it. 我已经创建了一个名为test_localhost_mysql的数据源,我选择了它。

完整的数据源信息

A window with MySQL Connector/ODBC connection parameters appears, with all of my connection data. 出现一个带有MySQL Connector / ODBC连接参数的窗口,其中包含我的所有连接数据。 I click Test. 我单击测试。

ODBC连接测试成功

success. 成功。

I click [OK] 我点击[确定]

Now, the Add Connection - Use connection string, is filled in, along with my login information. 现在,添加了“添加连接-使用连接”字符串以及我的登录信息。

I click Test Connection 我单击测试连接

添加连接测试成功

Success. 成功。

I click [OK] 我点击[确定]

configuration wizard is now complete, and shows a string. 配置向导现已完成,并显示一个字符串。

配置数据源完成

I click [NEXT] 我点击[下一步]

保存连接

I click [NEXT] without changing anything 我没有更改就单击[NEXT]

Now is when it becomes interesting. 现在是时候变得有趣了。 on this screen; 在此屏幕上;

数据源配置屏幕3

under Specify columns from a table or view - all my tables are in the drop down list. 在“从表或视图中指定列”下-我的所有表都在下拉列表中。 Periodically, the columns will show here as well. 这些列也会定期显示在此处。 Currently they aren't -- I'm sure this is not random, although I'm not sure what I'm doing to cause it. 目前他们不是-我确定这不是随机的,尽管我不确定我在做什么导致它。

I click [Next] after selecting my table. 选择表格后,单击[下一步]。

数据配置测试

I click [TEST] 我点击[测试]

数据配置测试失败

It fails. 它失败。

I am sure it's something simple, but I promise I've been through everything I can think of, and can really use some help please. 我敢肯定这很简单,但是我保证我会尽我所能,并且真的可以使用一些帮助。

Anyone that can guide me I would greatly appreciate it. 任何可以指导我的人,我将不胜感激。

I anxiously await your genious :) Thank you! 我焦急地等待您的慷慨:)谢谢!

Check this out. 看一下这个。 Try to install with the instructions here. 尝试按照此处的说明进行安装。 Report back if the issue persists. 如果问题仍然存在,请报告。 http://www.w3resource.com/mysql/mysql-odbc-connection.php http://www.w3resource.com/mysql/mysql-odbc-connection.php

EDIT: You also might want to run through all of your SQL code. 编辑:您可能还想遍历所有SQL代码。 It clearly says that the SQL syntax is not correct. 它清楚地表明SQL语法不正确。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在不卸载整个产品的情况下将Visual Studio 2013 Update 5还原到Visual Studio 2013更新4 - How can I restore Visual Studio 2013 Update 5 to Visual studio 2013 update 4 without uninstalling entire product mysql odbc驱动程序在Visual Studio 2008上可以正常运行,但在Visual Studio 2010上不能正常运行 - mysql odbc driver works fine on visual studio 2008 but not on visual studio 2010 如何将MonoGame安装到Visual Studio 2013中? - How can i install MonoGame into Visual Studio 2013? 如何在 Visual Studio 2013 中安装 MongoDB.Driver - How to install MongoDB.Driver in Visual Studio 2013 如何在Visual Studio 2013中配置SQL Server以允许远程连接 - How to configure SQL Server in Visual Studio 2013 to allow remote connection 如何创建模型 使用 Visual Studio 连接 ODBC mySQL - How To Create models Connect ODBC mySQL with Visual Studio MySQL for Visual Studio 2012/2013 - MySQL For Visual Studio 2012/2013 如何将 ODBC 连接与 Visual Studio 2019 和 .NET Core 3.0 结合使用? - How can I use ODBC connections with Visual Studio 2019 and .NET Core 3.0? 无法将Visual Studio 2013环境变量设置为有效 - Can't get setting Visual Studio 2013 Environment Variables to work 防止在 Visual Studio 2010 的 Crystal Report 中登录 ODBC 文本驱动程序 - Prevent login of ODBC Text driver in Crystal Report for Visual Studio 2010
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM