Ask questions via twitter! Message any question to @answers on twitter. We'll publish the question and send you a reply each time there's a new answer.
Next Question

Answered Question

 
M$3 December 24, 2008 07:08 AM

How to best connect Excel to a hosted MySQL installation?

There are tools out there such as Excel-DB that allow me to connect to a local MySQL database. However, I need to connect to a database that is hosted on GoDaddy and 1and1. Any ideas whether there's an ODBC applications that allow me to do so?
Interesting Question?  Yes (0)   No (0)   
RSS
 
 

Best Answer  Chosen by Asker

 
December 24, 2008 08:22 AM
I think there may be a firewall problem or missing piece of information (like an ip) or incorrect connection string that is preventing you from connecting to the hosted mysql. You might at some point verify with your hosting provider that this is even allowed for your account.

Here's this myodbc thing that seems like it may do what you ask http://www.automateexcel.com/2005/11/01/connect_excel_to_mysql_database/ but I don't think you necessarily need another tool (see previous paragraph)

But I have three questions:

1. First, have you verified that you will be able to connect using ANY application (such as Mysql administrator or the mysql command line) to your hosted mysql database server? You would need the hostname or ip, port, username and password. This may be an option on your account you have to set or it may not be allowed at all. Depends on your host and the type of account.

From reading your question and this stuff in your reply

"Also, this is about simultaneous multi-user lookup of data during a transaction, so the CSV route is not feasible. I'm considering Access, but need to do very heavy computations, thus I need Excel"

2. Now I'm curious, what are you actually doing? Usually when it gets that involved the spreadsheet doesn't handle it alone well and one starts developing an application rather than trying to make Excel do everything. In that case the calculations might be in Java or C++ or Python or whatever and the application would access the DB through standard APIs. OR another common scenario is to have a layer of application code around your mysql database that this financial application might call through a web API.

But.. maybe what you are trying to do makes sense and will actually work if you can connect. Just doesn't seem the standard approach. Although I don't have any details.

3. What sort of transactions? Are they actually financial transactions??
Source(s):
http://www.automateexcel.com/2005/11/01/connect_excel_to_mysql_database/



Helpful Answer?  (0)   (0)    Tip ilaksh for this answer
Permalink | Report
   Reply  
 
 
 
December 24, 2008 08:55 PM
Thanks for your feedback -- it helped me to find out about HTTP tunneling and why I need that for GoDaddy and 1and1. I have not tried it yet, though.

Our current GoDaddy database is accessible through PHP, so I know we can get to it.

I'm implementing an operator interface to a php/Java web application that many of our customers will use. The operator interface in Excel will allow operators (note the plural) to look at the data that is pertinent to them, do some heavy computational data crunching, allocate resources based on that data crunching and then write the resource allocation back into the database, so allocated resources are accessible to customers. Some of these resource allocations take place within seconds after reading the data, some within minutes, but all need up-to-date data to make decisions and then write back in real-time whatever decision was made. Eventually, as we solidify certain aspects of the operator interface, it will get "set in stone" (meaning, it will be programmed in PHP and Java), but the flexibility of Excel will always be needed. And yes, we are talking about transactions that involve money...

Report
 
 
 
December 24, 2008 11:53 PM
Ok it doesnt let me reply to you reply so I will write it here. Maybe Excel will work for that.. I mean it certainly is flexible and easy to do calculations with.

Does the version of Excel you are using handle the concurrency issues as far as having many users getting a live view of data? I think Microsoft is trying to address that with their newest or Live version or something and if not there is also stuff like Google docs spreadsheets or this EditGrid thing which were specifically designed to handle that aspect of it.

Report
 
 

Other Answers (4)

Sort By
 
December 24, 2008 07:19 AM
Yes, you can use ADO to create an ODBC connection between an excel spreadsheet and MySQL. It may even be a bit easier to import the excel data into Access and then use the data connection and querying abilities of Access.

Alternately you can export your Excel data to a CSV file and use the tools in MySQL to import the data file.


"What i suggest you is to save your excel file in .CSV format and then import it from mysql."
Source(s):
http://www.astahost.com/info.php/mysql-database-entry-by-excel-sheets_t1895...


Helpful Answer?  (0)   (0)    Tip kevinbernard31 for this answer
Permalink | Report
   Reply  
 
 
 
December 24, 2008 07:23 AM
Thanks, but my question centered around HOSTED mysql. I seem to not be able to connect to a hosted mysql installation whereas I can to a local one.

Also, this is about simultaneous multi-user lookup of data during a transaction, so the CSV route is not feasible.

I'm considering Access, but need to do very heavy computations, thus I need Excel. I cannot replicate the Excel formulas in VBA in Access. Impossible...

Report
 
 
 
December 24, 2008 07:56 AM
Some hosts require you to either set * (wildcard) for the host for hosts accessing the mysql database or else your IP. For example cpanel has a feature that facilitates this called Remote Database Access Hosts. However you really might as well just import your csv file.

Check with your host whether your able to remotely connect to your mysql database.
Source(s):
my own knowledge


Helpful Answer?  (0)   (0)    Tip underdogmike for this answer
Permalink | Report
   Reply  
 
 
 
December 24, 2008 08:47 PM
Thanks for the reply. I googled this further and it looks like GoDaddy and 1and1 need HTTP tunneling to get access to hosted MySQL databases. I should have access privileges on GoDaddy, but might not have them on 1and1...

Report
 
 
 
December 25, 2008 07:11 AM
As your using Excel to do a lot of calculations I'm assuming this is for reporting/analysis. In this case you may be better off exporting from mysql to a comma separated or tab separated file, them importing to excel for analysis.

An alternative is to write a php script that generates an html table and sets the content type of the page to automatically display in Excel.
Source(s):
http://www.evolt.org/article/Using_MySQL_and_PHP_to_Present_Excel_Spreadshe...


Helpful Answer?  (0)   (0)    Tip phrees for this answer
Permalink | Report
   Reply  
 
 

Answer this Question

How tips and payments work

This question has already been resolved. You may add an answer to it but you will not be eligible to win best answer or any associated tips.

Ask a Question


140 characters left
Top of Page
Buy Mahalo Dollars with Credit Card or PayPal

Top Members

This Week All Time
  • buddawiggi
    buddawiggi
    2nd Degree Black Belt
    27808 Points
    M$799.16 Earned
  • opher
    opher
    Purple Belt
    4473 Points
    M$196.22 Earned
  • annelisle
    annelisle
    Purple Belt
    3110 Points
    M$95.22 Earned
   See All
 

Most Popular Tags

mahalo(1635)
iphone(466)
music(464)
google(360)
food(325)
online(298)
beer(279)
money(263)
movies(262)
apple(253)
aotd(235)
health(220)
video(208)
free(206)
dog(205)
   See All
 

Categories

Welcome New Members


 
 
Mahalo Dollars are the currency of Mahalo Answers.

Each Mahalo Dollar costs $1.

Once you earn more than 40 Mahalo Dollars, you can request to be paid via PayPal. Each Mahalo Dollar is currently worth $0.75 when paid out via PayPal. Learn More

 
 

Please log in to use this function.