This document shows how to set up ODBC in Arch first on your localhost and then extends the steps to setup ODBC on

−

a server.

−

==Packages To Install==

−

Start by installing the unixodbc and myodbc

−

# pacman -Sy unixodbc

−

# pacman -Sy myodbc

−

−

==Configure Your ini Files==

−

Configure your "odbc.ini", ".odbc.ini", and "odbcinst.ini" file.

−

Startinig with odbcinst.ini, Su to root and set up your /etc/odbcinst.ini file as follows

−

[MySQL]

−

Description = ODBC Driver for MySQL

−

Driver = /usr/lib/libmyodbc.so

−

Setup = /usr/lib/libodbcmyS.so

−

FileUsage = 1

−

−

Next set up your "odbc.ini" and ".odbc.ini" file. "It should be pointed out here that the ".odbc.ini" file is just like the "odbc.ini" file except that it is a file that gets saved in the user's home dir.

−

[MySQL-test]

−

Description = MySQL database test

−

Driver = MySQL

−

Server = localhost

−

atabase = test

−

Port = 3306

−

Socket = /tmp/mysql.sock

−

Option =

−

Stmt =

−

==Create A Symbolic Link==

−

Next we need to create a symlink for libmyodbc.so. To do this we need to go to /usr/lib/myodbc3-3.51.12.so or

−

what the version of the module is and set up a symlink to libmyodbc.so

−

ln -s /usr/lib/libmyodbc3-3.51.12.so ./libmyodbc.so

−

==Renamed Modules==

−

OK, for this step I cheapskated it a little and simply renamed these files to agree with version of ODBC Arch

−

was looking for.

−

cp libcrypto.so.0.9.8 libcrypto.so.0.9.7

−

cp libcrypto.so.0.9.8 libcrypto.so.0.9.7

−

−

==Test Datbase==

−

On my machine I run phpmyadmin so I already had a test database to use. If you don't have a test database then

−

create one in MySQL.

−

−

==Testing the ODBC==

−

To set the ODBC connection run

−

isql MySQL-test

−

−

If you have a problem connecting then run

−

isql MySQL-test -v

−

−

==A Couple Useful Websites==

−

http://www.unixodbc.org/doc/OOoMySQL.pdf

−

−

This website got me going on ODBC with MySQL but left out somethings that were necessary for me

−

to get isql up and running. However this might be a good reference for the OpenOffice part.

If you want to add new database called foo for user bar and remote IP 202.54.10.20 then you need to type following commands at mysql> prompt:

−

−

mysql> CREATE DATABASE foo;

−

mysql> GRANT ALL ON foo.* TO bar@'202.54.10.20' IDENTIFIED BY 'PASSWORD';

−

Grant access to existing database

−

Let us assume that you are always making connection from remote IP called 202.54.10.20 for database called webdb for user webadmin then you need to grant access to this IP address. At mysql> prompt type following command for existing database: