Hi,
This is a start of a mini HowTo for getting Linux WebCatalog,
unixODBC, MyODBC to work with MySQL
It's a work in progress. The ODBC part worked only on 2 of 4 servers.
Q1: Do I have a config problem with unixODBC or MyODBC ?
Q2: Is there a way for force the ODBC Libraries to reload / reset
(or something)?
Q3: Are there other Linux clients to easily test the ODBC stuff with.
(that will return a better error message on ODBC conf issues)
I'm a MySQL / ODBC nubie, so there is a good chance that I'm doing
something wrong
with the configure / install of unixODBC and / or MyODBC
- I have 4 Linux servers on the Internet 3 RH 6.2 and one RH 7.0
- WebCatalog/ Apache work on all 4
- MySQL works on all 4
- ODBC only works on 2
- I set them up the same way by pasting the below commands into a
term window to avoid
typos and be consistent across all 4 servers.
- Using exact same odbc.ini and WebCatalog templates,
the 2 working servers and talk to all 4 test databases. (one of
them is local)
- The 4 databases are the same with an extra record containing the server name
- The servers are all remote so I can't use the ODBC GUI stuff.
## ODBC was written by Microsoft so all the books talk about running
it on Windows
## and using windows the configure ODBC
## On Linux, you can use a text editor to edit the odbc.ini files
## on Linux, my setup looks like this
1) Application (WebCatalog)
2) ODBC Driver Manager (unixODBC)
3) ODBC Driver (MyODBC)
--- internet ---
4) DB - MySQL server B -- MySQL server C -- etc.
I've installed WebCatalog / Apache many times
on many Linux configurations (even MacOSX).
http://www.smithmicro.com/isd/webcatalog/
WebCatalog / Apache works fine
and will give 'Error: SQL not supported'
if 'WebCatalog Prefs' does not contain the
correct path to unixODBC
- - - - -Edit - WebCatalog Prefs - - - - - - - - - -
SQLLibraryPath /usr/local/unixODBC/lib/libodbc.so
- - - - - - - - - - - - - - - - - - - - -
I don't get the 'SQL not supported' error, I get the other SQL error
which is returned for all other SQL problems
SQL Error: 00000
Playing arround with a working system, I can get
this error when
- odbc.ini is setup incorrectly
- the WebCat .tpl file has an error
- the remote and local passwords do not match
- the remote SQL server is down
and so on.
After Apache / WebCat was working, this is what I did:
## get the needed software
ncftpget
ftp://mirror.sit.wisc.edu/mirrors/mysql/Downloads/MySQL-3.23/MySQL-3.23.38-1.i386.rpm
ncftpget
ftp://mirror.sit.wisc.edu/mirrors/mysql/Downloads/MySQL-3.23/MySQL-client-3.23.38-1.i386.rpm
ncftpget
ftp://mirror.sit.wisc.edu/mirrors/mysql/Downloads/MySQL-3.23/MySQL-shared-3.23.38-1.i386.rpm
ncftpget
ftp://mirror.sit.wisc.edu/mirrors/mysql/Downloads/MySQL-3.23/MySQL-devel-3.23.38-1.i386.rpm
ncftpget
ftp://mirror.sit.wisc.edu/mirrors/mysql/Downloads/MyODBC/MyODBC-2.50.37.tar.gz
lynx http://www.unixodbc.org/unixODBC-2.0.6.tar.gz
## install the RPMs
rpm -Uvh MySQL-shared-3.23.38-1.i386.rpm
rpm -Uvh MySQL-devel-3.23.38-1.i386.rpm
rpm -Uvh MySQL-client-3.23.38-1.i386.rpm
rpm -Uvh MySQL-3.23.38-1.i386.rpm
on one server I needed:
rpm -Uvh --nodeps --force MySQL-3.23.38-1.i386.rpm
## get ready to compile
mv MyODBC-2.50.37.tar.gz /usr/local/
mv unixODBC-2.0.6.tar.gz /usr/local/
cd /usr/local/
tar xzf MyODBC-2.50.37.tar.gz
tar xzf unixODBC-2.0.6.tar.gz
cd /usr/local/unixODBC-2.0.6/
./configure \
--prefix=/usr/local/unixODBC \
--x-include=/usr/X11R6/include \
--x-libraries=/usr/X11R6/lib
## this make can take one hour
make
make install
cd /usr/local/MyODBC-2.50.37
./configure \
--prefix=/usr/local/unixODBC \
--with-mysql-dirs=/usr/lib/mysql \
--with-mysql-includes=/usr/include/mysql \
--with-unixODBC=/usr/local/unixODBC
make
make install
##
## build the odbcinst.ini and odbc.ini files
## using the same info from the working server
cd /usr/local/unixODBC/bin/
./odbcinst -i -d -f template_file
./odbcinst -i -s -f template_file1
- - - - - - template_file - - - - - - - - -
[Myodbc]
Decription = Myodbc
Driver = /usr/local/unixODBC/lib/libmyodbc.so
Setup = /usr/local/unixODBC/lib/libodbcmyS.so
- - - - - - - - - - - - - - - - - - - - -
- - - - - - template_file - - - - - - - - -
[MySQLone]
Description = myodbc
Driver = /usr/local/unixODBC/lib/libmyodbc.so
Trace = Yes
TraceFile = sql1.log
# need IP address for the server below
Server = 192.168.168.1
User = martin
Password = number9
Port = 3306
Socket =
Database = band
# repeat for each server
[MySQLtwo]
- - - - - - - - - - - - - - - - - - - - -
# - - - - - - My SQL setup - - - - - - - - - -
Using the MySQL area Webmin
http://www.webmin.com/webmin/
On each server I added a
- db called band
- table called Beatles
With varchar 30 fields: Name and inst
Then I pasted into the 'Execute SQL
INSERT INTO Beatles VALUES('George','Lead');
INSERT INTO Beatles VALUES('John','Rhythm');
INSERT INTO Beatles VALUES('Paul','Bass');
INSERT INTO Beatles VALUES('Ringo','Drums');
and on each server its name
INSERT INTO Beatles VALUES('Server','NumberOne');
- - - - - - - - - - - - - - - - - - - - -
# WebCat html page: one per server
- - - - - - testone.tpl - - - - - - - - - -
<!--HAS_WEBDNA_TAGS-->
<HTML>
<BODY bgcolor=#ffffff>
[thisURL] <br><br><br>
[sql dsn=MySQLone&username=martin&password=number9&statement=SELECT *
FROM Beatles;]
Found [NumFound] items<br>
[FoundItems]
Name = [Name], inst = [inst]<br>
[/FoundItems]
[/sql]
<b> DONE QUERY MySQL </b><br><br>
</BODY>
</HTML>
- - - - - - - - - - - - - - - - - - - - -
I wanted to be complete enough so that others could try the same setup.
TIA
- Jim
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <mysql-unsubscribe-##L=##[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php