- how to use an MS-Access file from Linux?
- 7 Answers 7
- Saved searches
- Use saved searches to filter your results more quickly
- License
- Licenses found
- mdbtools/mdbtools
- Name already in use
- Sign In Required
- Launching GitHub Desktop
- Launching GitHub Desktop
- Launching Xcode
- Launching Visual Studio Code
- Latest commit
- Git stats
- Files
- README.md
how to use an MS-Access file from Linux?
I’m studying an introductory course in databases and one of the exercises is to work with MS-Access. However I’m using Linux at home and although I can use the computer classes at the university it is far from convenient (limited open time — my studying time is mostly nights). So how can I use an Access file ( *.mdb ) in Linux? By use I mean changing tables, writing queries and so on. Are there tools to convert it to another database format (mysql, postgresql or even gadfly)? Also what problems may I encounter?
Thanks for all the answers. I forgot about OpenOffice Base. I hope to try the various suggestions during the weekend and see what works out best for me.
For more information on using [Open | Libre]Office Base with Access databases under Linux, see this answer on Ask Ubuntu.
7 Answers 7
Although a bit dated, I’ve had good success with mdbtools which is a set of command line tools for accessing and converting Access databases to other formats. I’ve used it for importing databases into PostgreSQL.
If you’re running an Ubuntu variant you can install it with:
sudo apt-get install mdbtools
or you can download it from here.
I will second that — but be warned that different versions of mdbtools will result in a slightly different output. Types and schema can vary.
To easily export full MS Access database using mdbtools tools from this answer, check out gist.github.com/turicas/2592877 script. To export to mysql (or postgresql) two lines should be fixed (described in comments from same link)
You’re out of luck. Access has no real equivalent on Linux and while Kexi is an interesting alternative that can import Access files and aims to provide similar functionality, it doesn’t actually uses Access files once the data is imported.
If your assignment is to develop an Access application with forms etc as opposed to just using and mdb database as a store, then you can try a recent release of Wine with a compatible Access version (see compatibility list) or, even better, find a Windows machine where you’re sure it’s going to work.
Not to be forgotten, the use of a Virtual Machine loaded with Windows would help you achieve the same thing on your Linux box.
I am currently trying Access with Wine on Ubuntu and I seem to be getting there. I have found that I need to copy various dlls manually, but that could easily be lack of reading up on the subject.
From the documentation: Connecting To Microsoft Access. However, this seems to indicate that you need access running in a windows host and connect via ODBC. See also Known Problems.
MS Jet does not run on anything but Windows. It’s record locking is very tightly tied to Windows file systems, and I won’t even allow my clients to store their MDBs on file servers that aren’t running native Windows file systems (that means no Novell and no Linux/Samba).
I recently discover https://dbeaver.io/ which is a software (in java) to manage different database types (MySQL, PostGreSQL…), a bit like phpmyadmin (but as a host based soft, no server require) and it can manage MS Access excep if version is too old (it is probably my case)
You can work with Access through a connection (ODBC or OLEDB), as long as you only need to manage the «database» dimension of the file (tables and views, which are called «queries» in Access).
Once the connection is open (see here for connection strings), you can send SQL commands to your mdb database, such as (where cn is here a connection object):
cn.execute "CREATE TABLE myTableName (myTable_id autoNumber, myTable_code Text, . )"
Please note that MsAccess uses a specific DDL that looks like the standard T-SQL but is not really it. Check the syntax in MsAccess help.
Depending on your database (and its constraints, default values, primary keys used, relations, data validation rules, aso), transfering Access can be easy and straight or might not even be possible. You will encounter a problem each time your database implement an access-specific/non-standard SQL rule.
If you really need to convert your access data to something else, I’d adise you to (1) export it under MS-SQL (the free version will be ok, an upsizing wizard is available in Access or on this site), (2)use an additional tool like this one to generate a «CREATE DATABASE» SQL Script, including or not data inserts, (3) use this script to try to create the database and its data on another database server.
Saved searches
Use saved searches to filter your results more quickly
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
MDB Tools — Read Access databases on *nix
License
GPL-2.0, Unknown licenses found
Licenses found
mdbtools/mdbtools
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Sign In Required
Please sign in to use Codespaces.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
Git stats
Files
Failed to load latest commit information.
README.md
Welcome to the exciting world of MDB Tools! MDB Tools is a set of programs to help you extract data from Microsoft Access files in various settings. See the NEWS file for information about the latest release.
The major pieces of MDB Tools are:
The core library that allows access to MDB files programatically. See mdbtools.h for the complete API.
Builds on libmdb to provide a SQL engine (aka Jet). See mdbsql.h for the complete API.
Provides command line utilities, including:
Command | Description |
---|---|
mdb-ver | Prints the version (JET 3 or 4) of an mdb file. |
mdb-schema | Prints DDL for the specified table. |
mdb-export | Export table to CSV or SQL formats. |
mdb-json | Export table to JSON format. |
mdb-tables | A simple dump of table names to be used with shell scripts. |
mdb-count | A simple count of number of rows in a table, to be used in shell scripts and ETL pipelines. |
mdb-sql | A simple SQL engine (also used by ODBC and gmdb). |
mdb-queries | List and print queries stored in the database. |
mdb-hexdump * | (in src/extras) Simple hex dump utility to look at mdb files. |
mdb-array * | Export data in an MDB database table to a C array. |
mdb-header * | Generates a C header to be used in exporting mdb data to a C prog. |
mdb-parsecsv * | Generates a C program given a CSV file made with mdb-export. |
See the man page of each program for usage instructions.
The src/util directory also contains a number of debugging tools, intended for developers. They are:
Command | Description |
---|---|
prcat | Prints the catalog table from an mdb file. |
prkkd | Dump of information about design view data given the offset to it. |
prtable | Dump of a table definition. |
prdata | Dump of the data given a table name. |
prole | Dump of ole columns given a table name and sargs. |
These tools are not installed on the host system.
An ODBC driver for use with unixODBC or iODBC driver manager. Allows one to use MDB files with PHP for example.
The Gnome MDB File Viewer and debugger. Recently ported to GTK+3 and moved to mdbtools/gmdb2.
Files in libmdb, libmdbsql, and libmdbodbc are licensed under LGPL and the utilities and gui program are under the GPL, see COPYING.LIB and COPYING files respectively.
First, you must have reasonably current installations of:
If you want to build the SQL engine, you’ll need bison (version >= 3.0) or byacc, and flex.
If you want to build the ODBC driver, you’ll need unixodbc-dev (version 2.2.10 or above) or iodbc.
If you want to build man pages, you’ll need GNU awk.