Excel 2013 MySQL Database Connection - SQL Server does not exist or access denied

0

I recently set up the most basic possible version of MySQL 5.6 and created a test schema in which a test table was placed. The connection is just named "Local instance MySQL" with host "localhost", port "3306" and server "MySQL Community Server (GPL).

I let SQL decide the user login name 'root'. I'm now trying to connect this test database to Excel using the data import 'From Other Sources' option.

When I try to establish a connection to server name "MySQL Community Server (GPL)" I receive the error "[DBNETLIB][ConnectionOpen (Connect().]SQL Server does not exist or access denied."

I've looked around and it turns out this is a very common and very generic error. So far I've made sure that the server is running that I can access it via MySQL workbench, and I've checked firewall settings. I was wondering if anyone has had the same problem occur after having just set up a basic test database for MySQL. I'm hoping that the fact that the associated database is just a locally hosted one table database without any bells or whistles will make it easier to diagnose the problem.

114

Posted 2014-12-23T19:28:33.540

Reputation: 337

"I've tried a few of the solutions without much luck." Since we're not mind readers, what exactly have you tried already, and what were the results. Have you confirmed the MySQL server services are actually running? Can you successfully connect to it using something like MySQL Workbench? – Ƭᴇcʜιᴇ007 – 2014-12-23T19:38:37.030

@'TECHIE007 Sorry, I've updated to be more clear. I suppose I haven't actually tried that much but many of the other solutions involve resetting I've never modified or handling components that this simple single table database doesn't have. – 114 – 2014-12-23T19:45:18.940

No problems. So you CAN access it via MySQL Workbench? – Ƭᴇcʜιᴇ007 – 2014-12-23T19:52:57.823

@'TECHIE007 Sorry, yes, all I have done so far with the database is create it in MySQL Workbench and run it locally. – 114 – 2014-12-23T19:55:28.670

So, let me get this straight, you're picking "From Other Sources" then "From SQL Server", and then typing "MySQL Community Server (GPL)" as the "Server Name" on that dialog screen, correct? – Ƭᴇcʜιᴇ007 – 2014-12-23T19:59:03.703

@'TECHIE007 Yes, have I made a mistake already in doing that? – 114 – 2014-12-23T20:02:50.373

Yup. :) I'll post an answer for you. – Ƭᴇcʜιᴇ007 – 2014-12-23T20:04:18.950

Answers

1

The SQL data connector in Excel is for connecting to Microsoft's SQL server. To connect to MySQL you'll need to install a specific connector for MySQL.

You can get a MySQL ODBC connector from Oracle here.

ODBC Driver for MySQL (Connector/ODBC)

Also, Oracle makes a utility called MySQL for Excel which should get you everything you need to hook up Excel to MySQL to pull data.

MySQL for Excel is an Excel Add-In that is installed and accessed from within the MS Excel’s Data tab offering a wizard-like interface arranged in an elegant yet simple way to help users browse MySQL Schemas, Tables, Views and Procedures and perform data operations against them using MS Excel as the vehicle to drive the data in and out MySQL Databases.

Ƭᴇcʜιᴇ007

Posted 2014-12-23T19:28:33.540

Reputation: 103 763

@'TECHIE007 That would be great, but it seems that it requires "Visual Studio Tools for Office 2010" which requires Visual Studio. Unfortunately I don't have Visual Studio. Is there another, worse way to add a connector for MySQL? – 114 – 2014-12-23T20:25:41.893

What makes you think that requires VS to use? – Ƭᴇcʜιᴇ007 – 2014-12-23T20:28:13.443

@'TECHIE007 It says so in the installer, after trying to install it nothing happened and it states "Visual Studio Tools for Office 2010 is not installed", which it states is a requirement. – 114 – 2014-12-23T20:30:00.210

Well isn't that silly. :) I never noticed because I have VS installed. OK, I added a link to answer that points to an ODBC connector download. ODBC connectors can be kind of sucky to distribute, but for your usage it will hopefully suffice. :) – Ƭᴇcʜιᴇ007 – 2014-12-23T20:31:52.413

@'TECHIE007 Once installed how do I use the connector? I tried accessing the server the same way with the same error. – 114 – 2014-12-23T20:34:43.387

@'TECHIE007 Thanks, unfortunately upon testing through Administrative Tools -> 'Data Sources (ODBC) I'm still getting the same error. Is there somewhere else I need to go to access ODBC databases other than "From SQL Server"? – 114 – 2014-12-23T20:49:48.280

1Ensure you're using the actual hostname of the computer (or "localhost", or the IP address) and not "MySQL Community Server (GPL)", as that name means nothing to the network. :) If you have a specific question about the setup of the ODBC connection, perhaps start a new question including what you've tried already and what the results were. – Ƭᴇcʜιᴇ007 – 2014-12-23T20:52:38.200