Warning, /RDBC/INSTALL.local is written in an unsupported language. File is not indexed.
0001
0002 Local installation of ROOT-RDBC-unixODBC-MySQL-MyODBC
0003
0004 ======================================================================
0005
0006
0007 The following is instruction for installation of "everything from scratch"
0008 in the user's local directory ( no system privileges required ).
0009 It's recommended only for testing of the package.
0010
0011
0012 1. ROOT installation
0013
0014 1.1. Download ROOT distribution.
0015 1.2. Unpack and set enviroment virables
0016 1.3. Test it
0017
0018
0019 2. Driver Manager installation
0020
0021 2.1. Download and unpack
0022 2.2. Configure, compile and install
0023 2.3. Test it
0024
0025
0026 3. MySQL-client installation
0027
0028 3.1. Download and unpack
0029 3.2. Configure, compile and install
0030 3.3. Test it
0031
0032
0033 4. ODBC driver installation
0034
0035 4.1. Download and unpack
0036 4.2. Configure, compile and install
0037
0038
0039 5. RDBC installation
0040
0041 5.1. Configure, compile and install
0042 5.2. Test it
0043 5.3. Create HTML documentation
0044
0045
0046 P.S.
0047
0048 ______________________________________________________________________
0049
0050
0051
0052 1. ROOT installation
0053
0054
0055 1.1. Download ROOT distribution
0056
0057 Go to <http://root.cern.ch/root/Availability.html> and
0058 get ROOT version 3.00 or higher.
0059
0060 For the moment when text was written I got
0061 "Intel x86 Linux for Redhat 6.1 (glibc 2.1) and egcs 1.1.2, version 3.00/05"
0062
0063 <ftp://root.cern.ch/root/root_v3.00.05.Linux.2.2.14.tar.gz>
0064
0065 Assume that $HOME/src directory is used for source downloads.
0066
0067
0068 1.2. Unpack and set enviroment virables
0069
0070 $ cd $HOME/src
0071 $ tar -xzvf root_v3.00.05.Linux.2.2.14.tar.gz
0072
0073 Choose the directory where ROOT will be installed.
0074 Assume that it is $HOME/root/v3.00.05 directory.
0075
0076 $ mkdir $HOME/root; mkdir $HOME/root/v3.00.05
0077 $ cp -rf $HOME/src/root/* $HOME/root/v3.00.05/
0078
0079 Enviroment virables should be set according to
0080 <http://root.cern.ch/root/EnvVars.html>
0081
0082 $ export ROOTSYS=$HOME/root/v3.00.05
0083 $ export PATH=$PATH:$ROOTSYS/bin
0084 $ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ROOTSYS/lib
0085
0086
0087 1.3. Test it
0088
0089 Usually I test ROOT by compiling programs/libs from $ROOTSYS/test
0090
0091 $ cd $ROOTSYS/test
0092 $ gmake
0093
0094 If compilation was OK, try one of my favorite tests:
0095
0096 $ root
0097 root [0] .L Tetris.so
0098 root [1] Tetris t
0099
0100
0101 ______________________________________________________________________
0102
0103
0104 2. Driver Manager installation
0105
0106
0107 There are few DriverManagers for Unixes required to run ODBC application.
0108 I'm using unixODBC.
0109
0110
0111 2.1. Download and unpack
0112
0113 Downloaded unixODBC from <http://www.unixODBC.org/download.html>
0114
0115 $ cd $HOME/src
0116 $ tar -xzvf unixODBC-2.0.4.tar.gz ( the latest at the moment when text was written )
0117
0118
0119 2.2. Configure, compile and install
0120
0121 $ cd unixODBC-2.0.4
0122
0123 By default unixODBC will be installed in /usr/local/ directory which requires
0124 system privileges. Use $ROOTSYS directory for "local installation".
0125
0126 $ ./configure --prefix=$ROOTSYS --disable-gui --disable-drivers
0127
0128 The options "--disable-gui" and "--disable-drivers" are used to create
0129 minimal configuration. To compile it just type:
0130
0131 $ gmake
0132
0133 The installation step
0134
0135 $ gmake install
0136
0137
0138 2.3. Test it
0139
0140 Skip the testing for the moment because it requires ODBC drivers to be installed.
0141 However for understanding how to work with unixODBC without GUI check:
0142
0143 <http://www.unixODBC.org/odbcinst.html>
0144
0145
0146 ______________________________________________________________________
0147
0148
0149 3. MySQL-client installation
0150
0151
0152 3.1. Download and unpack
0153
0154 Download MySQL source from <http://www.mysql.com/downloads/index.html>
0155 Look for "Source downloads for XXX" part of the page and get "Tarball".
0156 Put it into $HOME/src directory.
0157
0158 $ cd $HOME/src
0159 $ tar -xzvf mysql-3.23.33.tar.gz
0160
0161
0162 3.2. Configure, compile and install
0163
0164 $ cd mysql-3.23.33
0165
0166 To compile it "without server" and install it in $ROOTSYS just type:
0167
0168 $ ./configure --prefix=$ROOTSYS --without-server --without-bench\
0169 --without-docs --with-thread-safe-client\
0170 --enable-shared --disable-static
0171
0172 $ gmake
0173 $ gmake install
0174 $ cp -f $ROOTSYS/lib/mysql/* $ROOTSYS/lib/
0175
0176 Comment: libmysqlclient.so.10 should be located at $ROOTSYS/lib/
0177
0178 If something is going wrong check MySQL docs for help
0179 <http://www.mysql.com/doc/I/n/Installing.html>
0180
0181
0182 3.3. Test it
0183
0184 Try to connect to some MySQL server with mysql client program
0185 ( it's installed in $ROOTSYS/bin which is a part of $PATH after step 1.2 ).
0186
0187 $ mysql -u username -h mysql_server -p
0188
0189 Check MySQL docs for more inforamtion.
0190
0191
0192 ______________________________________________________________________
0193
0194
0195 4. ODBC driver installation
0196
0197
0198 4.1. Download and unpack
0199
0200 The steps are similar to which were done previously.
0201
0202 Go to <http://www.mysql.com/downloads/api-myodbc.html> and
0203 download the "Source for MyODBC on Unix" into $HOME/src dir.
0204
0205 $ cd $HOME/src
0206 $ tar -xzvf MyODBC-2.50.36.tar.gz
0207
0208
0209 4.2. Configure, compile and install
0210
0211 $ cd MyODBC-2.50.36
0212 $ ./configure --prefix=$ROOTSYS --with-unixODBC=$ROOTSYS\
0213 --with-mysql-libs=$ROOTSYS/lib\
0214 --with-mysql-includes=$ROOTSYS/include/mysql
0215 $ gmake
0216 $ gmake install
0217
0218 ______________________________________________________________________
0219
0220
0221 5. RDBC installation
0222
0223 Actuallly to compile and install RDBC only DriverManager required.
0224 This step can be done right after "2. Driver Manager installation".
0225
0226 If you are reading this text I assume RDBC is already downloaded,
0227 otherwise visit RDBC home for source download.
0228
0229
0230 5.1. Configure, compile and install
0231
0232 $ cd <RDBC source directory>
0233 $ ./configure --prefix=$ROOTSYS --with-odbc=$ROOTSYS
0234 $ gmake
0235 $ gmake install
0236
0237 If everything goes well, RDBC headers will be in $ROOTSYS/include,
0238 libRDBC.so will be in $ROOTSYS/lib, $ROOTSYS/macros/RDBC will contain
0239 the RDBC test macros ( check $ROOTSYS/macros/RDBC/README.RDBC )
0240
0241
0242 5.2. Test it
0243
0244 Try simple tests:
0245
0246 $ root
0247 root [0] gSystem->Load("libRDBC")
0248 root [1] con = gSQLDriverManager->GetConnection("mysql://mysql_host/test","username")
0249
0250 In case of successfull connection, the value of "con" will be non-zero,
0251 otherwise check the reason of error by "gSQLDriverManager->GetWarnings()->ls()"
0252
0253 To print out database metadata information, type:
0254 root [2] con->Print("all")
0255
0256 To print out databases available on the server, type:
0257 root [3] stmt = con->CreateStatement()
0258 root [4] rs = stmt->ExecuteQuery("show databases")
0259 root [5] rs->Print()
0260
0261 To print out all tables in "test" database, type:
0262 root [6] rs = stmt->ExecuteQuery("show tables")
0263 root [7] rs->Print()
0264
0265 Try RDBC tests from $ROOTSYS/macros/RDBC, e.g.
0266 root [8] .L RDBC/RDBCform.C
0267 root [9] DbForm form
0268
0269 That will run simple GUI form which can be used for table browsing.
0270
0271
0272 5.3. Create HTML documentation
0273
0274 To generate local copy of HTML documentation on RDBC classes
0275
0276 $ cd <RDBC source directory>
0277
0278 It is supposed that RDBC is compiled
0279
0280 $ gmake html
0281
0282 That will create htmldoc directory with HTML documentation
0283
0284
0285 ______________________________________________________________________
0286
0287
0288 P.S.
0289
0290 That's all! Questions, suggestions, comments to me:
0291
0292 Valeriy Onuchin <onuchin@sirius.ihep.su>
0293 IHEP, Protvino, Moscow region, Russia
0294
0295
0296 ______________________________________________________________________
0297
0298
0299 Visit RDBC home: <http://www.phenix.bnl.gov/WWW/publish/onuchin/RDBC/>
0300
0301
0302 ______________________________________________________________________
0303
0304
0305 $Id: INSTALL.local,v 1.1.1.1 2004/02/18 20:58:02 dave Exp $
0306