Friday, June 30, 2006

Writing NDBAPI programs - getting our environment

The first thing we have to do, before starting with any examples, is to setup our environment.

The linux kernel I am using is ( I am using Ubunto 6.06):
Linux stingray 2.6.15-25-386 #1 PREEMPT Wed Jun 14 11:25:49 UTC 2006 i686 GNU/Linux

The compiler I am using is ( g++ -v):
...
gcc version 4.0.3 (Ubuntu 4.0.3-1ubuntu5)

Another good thing to have is e.g. the NDBAPI documentation.
For this I will use MySQL 5.0.22, but the steps are the same for 5.1.X
  1. Download the source distribution of MySQL 5.0.22
  2. tar xvfz mysql-5.0.22.tar.gz
  3. cd mysql-5.0.22
  4. ./configure --with-ndbcluster --with-ndb-docs
  5. cd ndb/docs (in 5.1.X it is 'storage/ndb/docs')
  6. make
Now you have html documentation of the ndbapi, if you have got all the necessary things (like doxygen) installed to generate the documentation.
You will also get the documentation for the management api (mgmapi), but it will be covered later here.

Finally, I download the binary distribution of MySQL 5.0.22 and:
  1. cd /home/johan
  2. tar xvfz mysql-max-5.0.22-linux-i686-glibc23.tar.gz
  3. ln -s mysql-max-5.0.22-linux-i686-glibc23 mysql
Include files are located in:
mysql/include, mysql/include/ndb and mysql/include/ndb/ndbapi

Libraries are located in:
mysql/lib

Alright, I think we are good to go and continue with some examples. First of all how to connect an application to MySQL Cluster.

No comments: