You are on the right track.
First you install unixODBC then MyODBC then register the MyODBC driver
using the odbcinst command-line tool (since you are not using the GUI).
odbcinst -i -d -f myodbc.template
myodbc.template is a simple text file which can contain something like
the following...
[mysql]
Description = MyODBC-2.50.39
Driver = /usr/local/lib/libmyodbc.so
Setup = /usr/local/lib/libodbcmyS.so
FileUsage = 1
CPTimeout =
CPReuse =
Use your own file paths and leave Setup blank if you are not using the
GUI. The advantage of using odbcinst vs a text editor is that odbcinst
will ensure the correct file is updated.
Now you can do something similar for creating a DSN.
odbcinst -i -s -h -f dsn.template
dsn.template is a simple text file which can contain something like the
following...
[mysql]
Description = mysql database
Driver = mysql
Server = 192.168.1.26
Port =
Socket =
Database = mysql
In your case you probably want slightly different options. NOTE: The
Driver option can be set with a full path name to the library or the
user friendly name used when the driver was registered.
Next you want to test it. The best way to test things is to do the
following.
1. Use mysql command line tool to ensure that mysql client and server
are working properly.
2. Use isql command line tool (the one that comes with unixODBC) to
ensure that unixODBC and MyODBC are working properly. You may want to
turn verbose on when using isql for this purpose. If you have a problem
here then you may want to turn ODBC trace on.
3. Try your desired client software (i.e. StarOffice).
Peter
Ian C. Shay wrote:
> Hi,
> I'm having trouble getting StarOffice to connect to mysql
> via ODBC. I have mysql-3.23.49 up and running and I can
> connect fine to it from Windows machines on my local
> network. I can't get StarOffice on the Linux box running
> mysql to connect to it (StarOffice also connects fine from
> the Windows boxes). I've installed MyODBC-2.50.39 on Linux.
> I also have unixODBC-2.2.0. My principal difficulty with
> unixODBC is that I cannot compile the GUI because it
> requires Qt 2.2, while I only have 2.1. It appears that I
> cannot easily upgrade the library because it depends on a
> host of other packages, incl. glibc, which means I would
> pretty much have to upgrade everything on linux.
>
> So, I wrote an odbc.ini file (included below) by hand.
> StarOffice sees the data source but when attempting to
> connect I get "invalid database connection" error.
>
> My question is: do you have an idea whether this particular
> combination of drivers is supposed to work, and how I must
> configure my system to get it to work.
>
> Thanks!!
> Ian
>
> /etc/odbc.ini
> =================
>
> [mysqlRopotamo]
> Trace = No
> TraceFile= stderr
> Driver = /usr/lib/libmyodbc.so
> DSN = mysqlRopotamo
> Server = localhost
> UserName = yanko
> Password = my_password
> Port = 3306
> Protocol = 6.4
> #OPTIONS = 1
> Database = lightbulbs
> DB = lightbulbs
> SOCKET = /tmp/mysql.sock
>
>
>
> ---------------------------------------------------------------------
> Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
> posting. To request this thread, e-mail myodbc-thread5055@stripped
>
> To unsubscribe, send a message to the address shown in the
> List-Unsubscribe header of this message. If you cannot see it,
> e-mail myodbc-unsubscribe@stripped instead.
>
>
>
>