我是靠谱客的博主 失眠芒果,最近开发中收集的这篇文章主要介绍excel 2010 连接mysql,访问MySQL数据库到Excel 2010的powerpivot,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

I have a MySQL DB on hostmonster.com and I am trying import data in excel powerpivot, but having hard time connecting to it.

Does anyone know if Excel powerpivot can even connect to MySQL?

Error I am seeing

Unable to retrieve list of databases. Reason: Failed to connect to the server. Reason: Login timeout expired

A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.

Named Pipes Provider: Could not open a connection to SQL Server [53].

解决方案

I was looking for a way to feed data into MySQL (I know, there are better ways...) when I found this. So I was able to connect via odbc to Excel and using PowerPivot 2010 I was able to create a connection from MySQL to PP just fine. Here are the steps I took:

Select "Get External Data from Other Sources." (It's the db symbol to the right of "From Azure DataMarket.")

In the Connect to a Data Source table import wizard that comes up, select "Others (OLEDB/ODBC)"

Now it wants your connection string to your MySQL box, click on "Build." This brings up the "Data Link Properties" dialog, select the "Provider" tab, then the "Microsoft OLE DB Provider for ODBC Drivers." Select "Next." Now on the "Connection" tab, select "Specify the source of data: - use data source name: MySQL. (if you don't have this, you did not install the MySQL ODBC drivers.)

Click on "Test" and this should succeed if you have your user and password to MySQL correct. Now the "Connection String field is populated: "Provider=MSDASQL;Persist Security Info=False;User ID=root;DSN=MySQL" is what mine was.

The next step was a big one for me. The dialog says "Choose how to import the data" but when I selected "Select from a list of tables and views to choose the data to import" it could not find them for some reason, I selected "Write a query that will specify the data to import."

This brought up a query window and I added "select * from MySQL db.table_Sample

LIMIT 0, 1000"

It validated my SQL statements and imported the data. Very cool.

最后

以上就是失眠芒果为你收集整理的excel 2010 连接mysql,访问MySQL数据库到Excel 2010的powerpivot的全部内容,希望文章能够帮你解决excel 2010 连接mysql,访问MySQL数据库到Excel 2010的powerpivot所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(45)

评论列表共有 0 条评论

立即
投稿
返回
顶部