Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Tyler Frazier <tyfrazier@gmail.com> |
To | statalist@hsphsun2.harvard.edu |
Subject | Re: st: mysql to stata |
Date | Tue, 13 Jul 2010 13:00:47 -0400 |
OK it seems this was the solution http://dev.mysql.com/doc/refman/5.1/en/connector-odbc-configuration-dsn-windows.html now stata can find mysql with 'odbc list' here is the driver for future inquiries http://dev.mysql.com/downloads/connector/odbc/3.51.html --------------------------------------------------------------------------------------------------------------------------------------- I then run the following command . odbc load, dsn("accra") table("annual_employment_control_totals") but get this error The ODBC driver reported the following diagnostics [MySQL][ODBC 3.51 Driver][mysqld-5.1.48-community]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"annual_employment_control_totals"' at line 1 SQLSTATE=42000 r(682); I double checked the username and pwd -- looks right any ideas? thanks! Ty On Tue, Jul 13, 2010 at 12:29 PM, Tyler Frazier <tyfrazier@gmail.com> wrote: > What is the best way to connect stata to a mysql database .. I added > tosql for export, but there are still conversion errors in the type > (int, double, float, char, etc...) and it seems to be resulting errors > in my model. Also, I would like to import from MySQL edit and export > again. I have tried the odbc command but mysql is not recognized, Im > working through the drivers but wanted to give a quick email to get > some feedback confirming this is the right direction or not. Thanks! > Ty > * > * For searches and help try: > * http://www.stata.com/help.cgi?search > * http://www.stata.com/support/statalist/faq > * http://www.ats.ucla.edu/stat/stata/ > * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/