简体   繁体   中英

import .sql file to access 2016 from phpmyadmin

I have a database in phpmyadmin and I already exported it as test.sql. I want to import test.sql to ms access 2016. I tried to use import using ODBC but in some tutorials, I have to select Mysql in Machine Data Source but I don't have Mysql in the selection. Any idea how to import the test.sql file without using ODBC?

I don't believe that Access can consume a .sql file from MySQL.

What you do is have to spool up a instance of MySQL, import that MySQL file "into" MySQL. Yu then connect to the running instance of MySQL from Access with a set of MySQL odbc drivers.

Access ODBC can't process some ".sql" file, but installing MySQL odbc drivers on your computer, and THEN connecting to a running instance of MySQL via ODBC is the only way this will work.

If the ".sql" file is a series of sql "ddl" commands, then you could perhaps write code to read each line of the .sql file and process each line that you execute from Access (this would require VBA code).

So you better off to use Access ODBC + MySQL drivers - those drivers only can connect to a running instance of MySQL, and such ODBC drivers don't allow you to connect to some file. You don't use Access ODBC drivers to connect to some Oracle file, or SQL server file, or in this case some file some MySQL.

So AFTER you install the correct ODBC drivers from the given database vendor you then MUST connect via ODBC to a running instance of that database system. So Access ODBC does not connect to some "file", but to that of a running instance of some database server product.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM